# Button
An unstyled button component with compound composition and group support.
## Features
- Single component with `ButtonGroup` for grouping multiple buttons
- Native `` semantics with full HTML attribute support
- Icon composition via children, place icon components before or after text
## Usage
```tsx
import { Button } from 'primereact/button';
import { ButtonGroup } from 'primereact/buttongroup';
```
```tsx
```
## Behavior
### Icon Composition
Place icon components as children alongside text. DOM order determines icon position.
```tsx
import { Check } from '@primeicons/react/check';
/* Icon before text */
Confirm
;
/* Icon after text */
Save
;
```
### Polymorphic Rendering
Use `as` to change the rendered HTML element or use a custom React component.
```tsx
Home
```
### Render Function Children
`Button` accepts a render function as children, providing access to the component instance.
```tsx
{(instance) => Custom render }
```
## Pass Through
## API
### Button
| Attribute | Value |
| ------------ | ---------- |
| `data-scope` | `"button"` |
| `data-part` | `"root"` |
| Label | Type | Description |
|:------|:------|:------|
| root | ButtonPassThroughType> | Used to pass attributes to the root's DOM element. |
## Accessibility
### Screen Reader
`Button` renders a native `` element by default and uses its built-in semantics. Provide an accessible name with visible text, `aria-label`, or `aria-labelledby`. Icon-only buttons must use `aria-label` to ensure an accessible name.
### Keyboard Support
| Key | Function |
| ------- | ---------------------- |
| `tab` | Moves focus to button. |
| `enter` | Activates the button. |
| `space` | Activates the button. |