Components/Actions
Interactive docs page: https://wix-pages.com/design-system-documentation/#/component/button
Buttons let users initiate actions, like saving changes, navigating or canceling. They're used throughout the UI in various places like pages, widgets and modals.
<TextButton/> instead.Control button size with size prop:
large is best for calls to action that require more emphasis.medium is for main page actions and common use cases.small fits into smaller UI elements like cards and widgets.tiny is used for dense layouts.Each button has a priority that signals its importance. Use it to create a clear visual hierarchy across actions on the page.
primary is the main call-to-action.secondary is for supporting actions alongside a primary (e.g. Cancel, Back).tertiary is for low-emphasis actions; use when secondary would still feel too prominent.Note: There should only be one primary button per page.
Change the appearance of a button with a skin prop.
standard is for general primary actions.light is for primary actions that are on dark backgrounds.destructive is only for actions that have a destructive effect on user data, like delete.premium is for actions that prompt users to upgrade their plans to premium subscription.premium-light is best for upgrade actions that appear on dark backgrounds.dark should be used with buttons on backgrounds with colors.transparent is for general actions on backgrounds with vivid colors or images.ai should be used with AI based features.Add more context to actions with affix icons:
prefixIcon.suffixIcon.To disable a button, use the disabled prop which indicates a button can't be selected.
Use the ellipsis prop for overflow text. The full text will be displayed in a <Tooltip/> when a user hovers over the button. Control the style of the tooltip using the tooltipProps.
Note: Try to avoid lengthy action labels. CTA text should be short and clear – one to two words, or max three for specific use cases.
When working on mobile designs, use the fullWidth prop to fill the button to 100% of the parent container.
Render buttons as any given HTML tag with the as prop. For example, they can be rendered as:
<a> when attributes like href, target, etc., are needed.<Link> when props like to, replace, etc. are needed.All attributes will be passed to the rendered HTML tag.
When an action is delayed and still loading, use <Loader/> instead of a label on the button.
Place the primary CTA button in the <SidePanel.Footer/> to make sure it is always clearly visible to the user.
Not all actions are equal. Ranking them visually tells users what to do first, what's optional, and what's just there if they need it.
Disable the primary button when required fields are missing, and automatically enable it once all inputs are completed.
| Name | Type | Default | Description |
|---|---|---|---|
as | "button" | — | Renders component as any other component or a given HTML tag. |
children | ReactNode | — | Accepts any item as a child element. For all common cases pass a standard text string. |
dataHook | string | — | Applies a data-hook HTML attribute that can be used in the tests. |
disabled | boolean | — | Specifies whether user interactions are disabled. |
ellipsis | boolean | — | Specifies whether component handles text overflow with ellipsis. If enabled, a label that exceeds the available space is displayed inside a tooltip when the user hovers over the button. |
fullWidth | boolean | — | Sets button width to fill a 100% of a parent container width. |
onClick | MouseEventHandler | — | Defines a callback function which is called every time a button is clicked. |
prefixIcon | ReactElement | — | Pass an icon or a component to display at the front of a label (e.g., svg, image, etc.) |
priority | "primary" | "secondary" | "tertiary" | — | Specifies the priority of a button. |
ref | null | string | (instance: Button | null) => void | RefObject<Button> | — | Allows getting a ref to the component instance. Once the component unmounts, React will set ref.current to null (or call the ref with null if you passed a callback ref). |
showTooltip | boolean | — | Specifies whether the full button label is displayed in a tooltip when label overflows available space. Behaviour is enabled by default. Set property value to false to show ellipsis without a tooltip. |
size | "small" | "tiny" | "medium" | "large" | medium | Controls the size of a button. |
skin | "standard" | "light" | "inverted" | "destructive" | "premium" | "dark" | "transparent" | "premium-light" | "ai" | — | Specifies the skin of a button. |
suffixIcon | ReactElement | — | Pass an icon or a component to display at the end of a label (e.g., svg, image, etc.) |
tooltipProps | TooltipCommonProps | — | Allows to pass all common tooltip props. Use it to customize a tooltip created from text ellipsis. |
Import the driver matching your test environment:
| Method | Description |
|---|---|
getButtonTextContent | Gets button text |
isFocused | Checks whether button is focused |
isButtonDisabled | Checks whether button is disabled |
hasSkin | Checks whether button has a given skin |
isPrefixIconExists | Checks whether button has an icon prefix |
isSuffixIconExists | Checks whether button has an icon suffix |
exists | Checks whether the component found with the given data hook. |
element | Gets the component root element. |
click | Clicks on the component root element. |
base | Returns UniDriver for the base element. |
Last updated: 22 October 2026