Skip to content
  • Android
  • iOS
  • Web

Button

A Button component is a fundamental UI element that allows users to trigger actions or events, such as submitting a form, opening a dialog, or navigating to another page. Buttons are interactive and typically styled to stand out, making it easy for users to identify and interact with them. They can come in various types, such as primary, secondary, or disabled, depending on their purpose or state.

Live examples

Example.tsx

Press a button to see the result.

Attributes

NButton attributes
NameTypeDefaultDetails
disabledbooleanfalsePrevents interaction.
classNamestringOptionalSupported Tailwind-style utilities, resolved entirely in Rust. See the engine README.
isOutlinebooleanfalseUses a transparent background with an outline.
isLoadingbooleanfalseShows the loading label and disables the button.
loadingTextstringLoading…Label shown while the button is loading.
leftIconReactNodeOptionalContent displayed before the button label.
rightIconReactNodeOptionalContent displayed after the button label.
childrenReactNodeOptionalThe button label or content.
onPress(() => void)OptionalCalled when the user activates the button.
Engine reference for ButtonSet up engine components

Tags