# @gluestack-ui/button

> A universal headless Button component for React Native, Next.js & React

Latest version **1.0.14** (published 2025-03-11) · 0 weekly downloads

## Install

```sh
npm install @gluestack-ui/button
pnpm add @gluestack-ui/button
yarn add @gluestack-ui/button
bun add @gluestack-ui/button
```

## Health

**Score 50/100 (C)** — status: stable.

Positive: has types; esm support; no vulnerabilities; high maintenance score.

Warnings: low downloads.

Negative: stale.

## Facts

| | |
|---|---|
| Version | 1.0.14 |
| Published | 2025-03-11 |
| First published | 2023-02-21 |
| Weekly downloads | 0 |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 3 |
| Unpacked size | 27.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 5305 |
| Maintainers | vidhi499, rohit_singh, viraj-10, rayan1810, rajat693, surajahmedc, meenumakkar, madhavb230100, vaibhk002, daminipandey, amars29, geekgautam, sravankumarvelangi, gluestackadmin, geekashwini, mayankp06 |
| Keywords | react, native, react-native, button, gluestack-ui, universal, headless, typescript, component, android, ios, nextjs |

## Links

- npm: https://www.npmjs.com/package/@gluestack-ui/button
- Repository: https://github.com/gluestack/gluestack-ui
- Homepage: https://github.com/gluestack/gluestack-ui/tree/main/packages/unstyled/button#readme
- Issues: https://github.com/gluestack/gluestack-ui/issues
- npm.io page: https://npm.io/package/@gluestack-ui/button

## Dependencies (3)

- [@gluestack-ui/utils](https://npm.io/package/@gluestack-ui/utils.md) 0.1.15
- [@react-native-aria/focus](https://npm.io/package/@react-native-aria/focus.md) ^0.2.9
- [@react-native-aria/interactions](https://npm.io/package/@react-native-aria/interactions.md) 0.2.16

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 1.0.14 (latest) — 2025-03-11
- 1.0.8-alpha.15 (alpha) — 2024-11-08
- 1.0.13 — 2025-03-03
- 1.0.12 — 2025-02-19
- 1.0.11 — 2025-02-18
- 1.0.10 — 2025-02-18
- 1.0.9 — 2025-02-18
- 1.0.8 — 2024-11-11
- 1.0.8-alpha.14 — 2024-11-08
- 1.0.8-alpha.13 — 2024-11-08
- 1.0.8-alpha.12 — 2024-11-08
- 1.0.8-alpha.11 — 2024-11-08
- 1.0.8-alpha.10 — 2024-11-08
- 1.0.8-alpha.1 — 2024-11-08
- 1.0.8-alpha.0 — 2024-11-08
- … 44 more at https://npm.io/package/@gluestack-ui/button/versions

## README

# @gluestack-ui/button

## Installation

To use `@gluestack-ui/button`, all you need to do is install the
`@gluestack-ui/button` package:

```sh
$ yarn add @gluestack-ui/button

# or

$ npm i @gluestack-ui/button
```

## Usage

A button component is a graphical user interface element that enables users to act by clicking or tapping. It can be customized in size, shape, color, and behavior to fit the design of the application or website. Here's an example how to use this package to create one:

```jsx
import { createButton } from '@gluestack-ui/button';
import {
  Root,
  Text,
  Group,
  GroupHSpacer,
  GroupVSpacer,
  Spinner,
  Icon,
} from './styled-components';

export const Button = createButton({
  Root,
  Text,
  Group,
  GroupHSpacer,
  GroupVSpacer,
  Spinner,
  Icon,
});
```

## Customizing the Button:

Default styling of all these components can be found in the components/core/button file. For reference, you can view the [source code](https://github.com/gluestack/gluestack-ui/blob/development/example/storybook/src/ui-components/Button/index.tsx) of the styled `Button` components.

```jsx
// import the styles
import {
  Root,
  Text,
  Group,
  GroupHSpacer,
  GroupVSpacer,
  Spinner,
} from '../components/core/button/styled-components';

// import the createButton function
import { createButton } from '@gluestack-ui/button';

// Understanding the API
const Button = createButton({
  Root,
  Text,
  Group,
  GroupHSpacer,
  GroupVSpacer,
  Spinner,
});

// Using the button component
export default () => (
  <ButtonGroup>
    <Button>
      <ButtonText />
      <ButtonSpinner />
      <ButtonIcon />
    </Button>
  </ButtonGroup>
);
```

More guides on how to get started are available
[here](https://ui.gluestack.io/docs/components/forms/button).

---
_Source: https://npm.io/package/@gluestack-ui/button · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
