Castle logo

CASTLE UI

Search

K

Used to trigger actions, submit forms, or navigate users through the application. The Button component is highly customizable, supporting various styles, icons, loading states, and sizes to fit different use cases.

Usage

Import

import { Button } from '@passfort/castle'

Copy

Styles

Use the type prop to change the Button's appearance and behavior. Available types include:

  • default,
  • primary,
  • positive,
  • negative,
  • read-only,
  • disabled,
  • stroke,
  • submit,
  • text,
  • ghost, and
  • active.

Copy

live example

Icons

Use the icon and iconRight props to add icons to the left and right sides of the button, respectively.

Copy

live example

Icon only

Create buttons that contain only an icon without any label. This is useful for actions like close buttons or toggles.

Copy

live example

Loading

Copy

live example

Connected Buttons

Use the Connected component with a custom group prop to achieve a connected button effect. By default, buttons belong to the group="button".

import { Connected } from '@passfort/castle'

Copy

Copy

live example

Small buttons

Toggle the small prop to render smaller versions of the button, suitable for compact interfaces or denser layouts.

Copy

live example

Customisation

Customize the button's content and structure using sub-components like Button.Icon and Button.Text. This allows for more complex button layouts and integrations.

Copy

live example

HTML Submit

Use buttons with the type="submit" prop within form elements to handle form submissions.

Copy

live example

Contents