Skip to main content
Give us your valuable feedback

It will help us understand how we can serve you better

Give feedback

Components

Button

Used to initiate an action or trigger the users

banner-Button
Component Status Details

Status component contains a list of checks and completeness that has been tested and owned by each component

check-list-icon We don't use color as the only visual tool to convey information.
check-list-icon The component’s structure and properties include relevant options such as variant, style, size, orientation, optional iconography, decorations, selection, error state, etc.check-list-icon The title is the component name that uses the frame base component template.check-list-icon The base component name contains: .Base & "Component Name" if there is more than one.check-list-icon All component properties use the Legion foundation.
check-list-icon We can change all the parts that are connected to the component base.check-list-icon The inside of the base component remains connected to the master component.check-list-icon All variant options are not damaged when we change from one to another.check-list-icon Overriding changes to components will not reset other variants.
check-list-icon Component's already has component specs documentation.

Status

Resources

Usage

To implement Button, you can use this tag

import { Button } from "@legion-crossplatform/ui";

Buttons are commonly used in user interfaces to initiate an action or prompt the user to open a link. They can contain a combination of clear and concise labels as well as icons to provide additional context. Legion provides a variety of options to customize your buttons to match your desired aesthetic and functionality.

Variants

Legion has various color themes:

  1. Color Primary Theme.
  2. Color Secondary Theme.
  3. Color Tertiary Theme.
  4. Color Warning Theme.
  5. Color Success Theme.
  6. Color Error Theme.

In this page we will demonstrate the usage using the primary variant. Each theme has four variants:

Solid

Button Legion React Native
import { Button } from "@legion-crossplatform/ui";
<Button variant="primary">Button</Button>
// or you can just use the default variant
<Button>Solid primary</Button>

Soft

Button Legion React Native
import { Button } from "@legion-crossplatform/ui";
<Button variant="softPrimary">Button</Button>

Outline

Button Legion React Native
import { Button } from "@legion-crossplatform/ui";
<Button variant="outlinePrimary">Button</Button>

Transparent

import { Button } from "@legion-crossplatform/ui";
<Button variant="transparentPrimary">Button</Button>

Icon

You can set the button to have an icon to the left or right side of the text.

import { Button } from "@legion-crossplatform/ui";
import { Activity, Airplay } from '@tamagui/lucide-icons'
// Add icon before text
<Button icon={Activity} size="$3">
IconBefore
</Button>
//Add icon after text

Attributes

Attribute NameTypeDescription
circularbooleanMakes the button rounded
iconJSX.ElementPass any React element, appears before text
iconAfterJSX.ElementPass any React element, appears after text
noTextWrapbooleanIf true, button won’t wrap content with a Text element
scaleIconnumberScale the icon more than the default value by this number
scaleSpacenumberScale the spacing more than the default value by this number
spaceFlexbooleanMakes all space elements have Flex display rule
sizestring | tokens.sizeSet a size, number, or one of the size token values