Trigger an action or event, such as submitting a form or displaying a dialog.
<Button>
<BookmarkIcon width="16" height="16" /> Bookmark
</Button>
This component is based on the button
element and supports common margin props.
Use the size
prop to control the size.
<Flex gap="3" align="center">
<Button size="3" variant="soft">
Edit profile
</Button>
<Button size="2" variant="soft">
Edit profile
</Button>
<Button size="1" variant="soft">
Edit profile
</Button>
</Flex>
Use the variant
prop to control the visual style.
<Flex gap="3">
<Button variant="classic">Edit profile</Button>
<Button variant="solid">Edit profile</Button>
<Button variant="soft">Edit profile</Button>
<Button variant="outline">Edit profile</Button>
<Button variant="surface">Edit profile</Button>
</Flex>
Use the ghost
variant to render the button without a visually containing element. Ghost buttons behave differently in layout as they use a negative margin to optically align themselves against their siblings while maintaining their padded active and hover states.
<Flex gap="3" align="center">
<Button variant="solid">Edit profile</Button>
<Button variant="ghost">Edit profile</Button>
<Button variant="soft">Edit profile</Button>
</Flex>
Use the color
prop to assign a specific color, ignoring the global theme.
<Flex gap="3">
<Button color="indigo" variant="soft">
Edit profile
</Button>
<Button color="cyan" variant="soft">
Edit profile
</Button>
<Button color="orange" variant="soft">
Edit profile
</Button>
<Button color="crimson" variant="soft">
Edit profile
</Button>
</Flex>
Use the highContrast
prop to add additional contrast.
<Flex direction="column" gap="3">
<Flex gap="3">
<Button variant="classic">Edit profile</Button>
<Button variant="solid">Edit profile</Button>
<Button variant="soft">Edit profile</Button>
<Button variant="outline">Edit profile</Button>
<Button variant="surface">Edit profile</Button>
</Flex>
<Flex gap="3">
<Button variant="classic" highContrast>
Edit profile
</Button>
<Button variant="solid" highContrast>
Edit profile
</Button>
<Button variant="soft" highContrast>
Edit profile
</Button>
<Button variant="outline" highContrast>
Edit profile
</Button>
<Button variant="surface" highContrast>
Edit profile
</Button>
</Flex>
</Flex>
Use the radius
prop to assign a specific radius value, ignoring the global theme.
<Flex gap="3">
<Button radius="none" variant="soft">
Edit profile
</Button>
<Button radius="large" variant="soft">
Edit profile
</Button>
<Button radius="full" variant="soft">
Edit profile
</Button>
</Flex>
You can nest icons directly inside the button. The correct gap is provided automatically.
<Flex gap="3">
<Button variant="classic">
<BookmarkIcon width="16" height="16" /> Bookmark
</Button>
<Button variant="solid">
<BookmarkIcon width="16" height="16" /> Bookmark
</Button>
<Button variant="soft">
<BookmarkIcon width="16" height="16" /> Bookmark
</Button>
<Button variant="outline">
<BookmarkIcon width="16" height="16" /> Bookmark
</Button>
<Button variant="surface">
<BookmarkIcon width="16" height="16" /> Bookmark
</Button>
</Flex>