Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(core): Implements a button group component #7

Merged
merged 7 commits into from
Jul 28, 2024
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
493 changes: 493 additions & 0 deletions apps/tester/tests/tj-button-group.spec.tsx

Large diffs are not rendered by default.

84 changes: 84 additions & 0 deletions apps/website/docs/apis/button-group.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
---
sidebar_position: 2
title: <ButtonGroup />
---

# ButtonGroup API

<AvailableFrom version="0.2.0" />

API reference docs for the React ButtonGroup component. Learn about the props of this exported module.

## Demos

:::tip

For examples and details on the usage of this React component, visit the component demo pages:

- [Button Group](../components/button-group)

:::

## Import

```jsx
import { ButtonGroup } from 'tailwind-joy/components';
```

## Props

:::info

The `ref` is forwarded to the root element.

:::

By default, props available for HTML `<div>` are also available for ButtonGroup component. Other props are as follows:

### `buttonFlex`

The flex value of the button.

- Type: `number | string`

### `color`

The color of the component.

- Type: `'primary' | 'neutral' | 'danger' | 'success' | 'warning'`
- Default: `'neutral'`

### `disabled`

If `true`, all the buttons will be disabled.

- Type: `boolean`
- Default: `false`

### `orientation`

The component orientation.

- Type: `'horizontal' | 'vertical'`
- Default: `'horizontal'`

### `size`

The size of the component.

- Type: `'sm' | 'md' | 'lg'`
- Default: `'md'`

### `spacing`

Defines the space between the type `item` components. It can only be used on a type `container` component.

- Type: `string`
- Default: `'0'`

### `variant`

The variant of the component.

- Type: `'solid' | 'soft' | 'outlined' | 'plain'`
- Default: `'outlined'`
2 changes: 1 addition & 1 deletion apps/website/docs/apis/circular-progress.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
sidebar_position: 2
sidebar_position: 3
title: <CircularProgress />
---

Expand Down
2 changes: 1 addition & 1 deletion apps/website/docs/apis/icon-adapter.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
sidebar_position: 3
sidebar_position: 4
title: <IconAdapter />
---

Expand Down
2 changes: 1 addition & 1 deletion apps/website/docs/apis/icon-button.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
sidebar_position: 4
sidebar_position: 5
title: <IconButton />
---

Expand Down
2 changes: 1 addition & 1 deletion apps/website/docs/apis/linear-progress.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
sidebar_position: 5
sidebar_position: 6
title: <LinearProgress />
---

Expand Down
Loading