Button
Starts an action such as save, continue, or open a panel.
Import
Section titled “Import”import { Button } from "@pelagornis/page/components";Example
Section titled “Example”The preview above renders this file. Copy it into src/components/ to start from it.
import { Button, Stack, WebIcon } from "@pelagornis/page/components";
export default function ButtonDemo() { return ( <Stack direction="row" gap="sizeSmall" align="center" wrap> <Button variant="primary">Continue</Button> <Button variant="secondary">Secondary</Button> <Button variant="outline">Outline</Button> <Button variant="ghost">Ghost</Button> <Button variant="primary" disabled> Disabled </Button> <Button variant="ghost" layout="icon" aria-label="Add"> <WebIcon name="add" size={20} color="currentColor" /> </Button> </Stack> );}Use in MDX
Section titled “Use in MDX”Button can be written straight in an .mdx page. Import it below the frontmatter. It renders on the server, so no client directive is needed.
---title: Example---
import { Button } from "@pelagornis/page/components";
<Button variant="primary">Continue</Button><Button variant="outline" size="sm">Cancel</Button>Use in Markdoc
Section titled “Use in Markdoc”pageMarkdoc() registers a button tag for this component. Add the preset once in markdoc.config.mjs (see Use in Markdoc), then write the tag in any .mdoc page.
{% button variant="primary" %}Continue{% /button %}{% button variant="outline" size="sm" %}Cancel{% /button %}Attributes use the same names and values as the React props.
Variants
Section titled “Variants”Values the component accepts for each variant prop.
| Prop | Values |
|---|---|
variant | primary secondary outline ghost |
size | sm md lg |
layout | label icon |
Anatomy
Section titled “Anatomy”Parts of the component and the data-refineui role each one renders.
| Part | Role |
|---|---|
root | button |
icon | optional |
label | required |
States
Section titled “States”States the component styles. Component states are exposed as data attributes.
| Kind | States |
|---|---|
| Pseudo | hover active focus-visible |
| Availability | disabled aria-disabled data-inactive |
| data-state | loading |
Keyboard
Section titled “Keyboard”Keys the component handles when it has focus.
| Key | Action |
|---|---|
| Enter | activate |
| Space | activate |
Reference
Section titled “Reference”- RefineUI · Button for design guidance and token detail.
- Use in MDX and Use in Markdoc for the general rules.