Icon Button
Native Solid 2 fork. Original documentation and designs © WorkOS; historical posts retain their original context.
API Reference
This component is based on the button element and supports common margin props.
Examples
It's strongly recommended to include an aria-label or aria-labelledby prop on Icon Button components since they don't contain visible text. Screen readers rely on this label to announce the button's purpose to users.
Size
Use the size prop to control the size of the button.
Variant
Use the variant prop to control the visual style of the button.
Ghost
Use the ghost variant to display a button without chrome. Ghost buttons behave like text in layout, as they use a negative margin to optically align themselves against their siblings while maintaining the padding in active and hover states.
Color
Use the color prop to assign a specific color.
High-contrast
Use the highContrast prop to increase color contrast with the background.
Radius
Use the radius prop to assign a specific radius value.
Loading
Use the loading prop to display a loading spinner in place of button content. The button will be disabled while loading.