Button
View Source
Used for any type of user action, including navigation.
const themes = [{ title: 'Default' },{ title: 'Primary', theme: 'primary' },{ title: 'Success', theme: 'success' },{ title: 'Warning', theme: 'warning' },{ title: 'Error', theme: 'error' },{ title: 'Info', theme: 'info' },]const variants = ['fill', 'outline', 'naked']render(<StackView alignment="center" spacing={1}>{variants.map((variant) => (<StackView key={variant} axis="horizontal" spacing={1}>{themes.map(({ title, theme }) => (<Button key={title} title={title} theme={theme} variant={variant} />))}</StackView>))}</StackView>)
render(<StackView axis="horizontal"><StackViewaxis="horizontal"padding={1}spacing={1}backgroundColor="grey-2"><Button title="Dark" theme="dark" /><Button title="Dark" theme="dark" variant="outline" /><Button title="Dark" theme="dark" variant="naked" /></StackView><StackViewaxis="horizontal"padding={1}spacing={1}backgroundColor="grey-8"><Button title="Light" theme="light" /><Button title="Light" theme="light" variant="outline" /><Button title="Light" theme="light" variant="naked" /></StackView></StackView>)
render(<StackViewaxis="horizontal"padding={1}spacing={1}backgroundColor="primary-light"><Button title="White" theme="white" /><Button title="White" theme="white" variant="outline" /><Button title="White" theme="white" variant="naked" /><Button title="Light" theme="light" /><Button title="Light" theme="light" variant="outline" /><Button title="Light" theme="light" variant="naked" /></StackView>)
render(<StackView spacing={2}><StackView axis="horizontal" alignment="start" spacing={1}>{['xs', 'sm', 'md', 'lg'].map((size) => (<Buttonkey={size}size={size}title="person"spinner={true}variant="outline"/>))}</StackView><StackView axis="horizontal" alignment="start" spacing={1}>{['xs', 'sm', 'md', 'lg'].map((size) => (<Button key={size} size={size} title="Button" />))}</StackView><StackView axis="horizontal" alignment="start" spacing={1}>{['xs', 'sm', 'md', 'lg'].map((size) => (<Buttonkey={size}size={size}title="Button"iconLeft={{ name: 'general.twoPeople' }}/>))}</StackView><StackView axis="horizontal" alignment="start" spacing={1}>{['xs', 'sm', 'md', 'lg'].map((size) => (<Buttonkey={size}size={size}title="Button"iconRight={{ name: 'general.downCaret' }}/>))}</StackView><StackView axis="horizontal" alignment="start" spacing={1}>{['xs', 'sm', 'md', 'lg'].map((size) => (<Buttonkey={size}size={size}icon={{ name: 'general.person' }}tooltip={{ title: 'person' }}radius="circle"/>))}</StackView></StackView>)