Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 22 additions & 1 deletion apps/ui/skills/coss/references/primitives/button.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,25 @@ Button with icon and text (no opacity on the icon):

Sizes: `xs`, `sm`, `default`, `lg`, `icon-xs`, `icon-sm`, `icon`, `icon-lg`.

### Loading state

Built-in `loading` prop (disables and shows spinner automatically):

```tsx
<Button loading={isLoading} onClick={handleClick}>Submit</Button>
```

Composite approach (manual `Spinner` + `disabled`):

```tsx
<Button disabled>
<Spinner />
Loading...
</Button>
```

Prefer the `loading` prop for typical async actions. Use the composite approach when you need custom spinner placement or label.

### More examples

- default: `p-button-1`
Expand All @@ -85,4 +104,6 @@ Sizes: `xs`, `sm`, `default`, `lg`, `icon-xs`, `icon-sm`, `icon`, `icon-lg`.

## Useful particle references

See particles `p-button-1` through `p-button-8` for all variant/size combinations.
- variants/sizes: `p-button-1` through `p-button-8`
- composite loading (Spinner + disabled): `p-button-18`
- built-in loading prop: `p-button-41`
2 changes: 1 addition & 1 deletion apps/ui/skills/coss/references/primitives/drawer.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ Drawer with handle:
</DrawerPanel>
<DrawerFooter>
<Button>Save</Button>
<DrawerClose render={<Button variant="outline" />}>Cancel</DrawerClose>
<DrawerClose render={<Button variant="ghost" />}>Cancel</DrawerClose>
</DrawerFooter>
</DrawerPopup>
</Drawer>
Expand Down
2 changes: 1 addition & 1 deletion apps/ui/skills/coss/references/primitives/sheet.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ Sheet from the right side with form:
</Field>
</SheetPanel>
<SheetFooter>
<SheetClose render={<Button variant="outline" />}>Cancel</SheetClose>
<SheetClose render={<Button variant="ghost" />}>Cancel</SheetClose>
<Button>Save</Button>
</SheetFooter>
</SheetPopup>
Expand Down
1 change: 1 addition & 0 deletions apps/ui/skills/coss/references/rules/styling.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ Use this guide when writing or updating coss primitives, particles, and docs exa
- Many primitives already define inner SVG sizing. Check existing component styles before adding icon `size-*` classes.
- Many primitives already define inner SVG opacity (commonly around `opacity-80`). Check existing component styles before adding manual icon opacity classes.
- Prefer data-slot-aware selectors and `in-*` patterns over `group` where available.
- Cancel/close buttons in Dialog, AlertDialog, Sheet, and Drawer footers use `variant="ghost"`. Reserve `variant="outline"` for triggers that open overlays, not for dismissing them.

## Global Styling Setup (when relevant)

Expand Down
Loading