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: new toolbar component and button property #8050

Merged
merged 4 commits into from
May 8, 2024
Merged
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
22 changes: 22 additions & 0 deletions src/content/docs/en/reference/dev-toolbar-app-reference.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -434,6 +434,14 @@ The style of the button (`ghost`, `outline`, `purple`, `gray`, `red`, `green`, `

In JavaScript, set this property using the `buttonStyle` property to avoid conflict with the native `style` property.

#### `button-border-radius`

Princesseuh marked this conversation as resolved.
Show resolved Hide resolved
<p><Since v="4.8.0" /></p>

The border radius of the button (`normal`, `rounded`). When using `rounded`, the button will have rounded corners and uniform padding on all sides.

In JavaScript, set this property using the `buttonBorderRadius` property.

### `astro-dev-toolbar-badge`

Shows a badge.
Expand Down Expand Up @@ -485,6 +493,20 @@ toggle.input.addEventListener('change', (evt) => {
});
```

### `astro-dev-toolbar-radio-checkbox`

Princesseuh marked this conversation as resolved.
Show resolved Hide resolved
<p><Since v="4.8.0" /></p>

Shows a radio checkbox. Similar to the `astro-dev-toolbar-toggle` component, this element is a simple wrapper around a native `<input type="radio">` element. The radio element can be accessed using the `input` property.

```ts
const radio = document.createElement('astro-dev-toolbar-radio-checkbox');

radio.input.addEventListener('change', (evt) => {
console.log(`The radio is now ${evt.currentTarget.checked ? 'enabled' : 'disabled'}!`);
});
```

#### `toggle-style`

The style of the toggle (`purple`, `gray`, `red`, `green`, `yellow`, `blue`).
Expand Down
Loading