4.4.4 • Published 20 hours ago

@oliasoft-open-source/react-ui-library v4.4.4

Weekly downloads
-
License
MIT
Repository
gitlab
Last release
20 hours ago

React UI Library

Description

The React UI Library by Oliasoft is a versatile set of React UI components designed for building modern web applications. It offers a comprehensive suite of layout, navigation, and control components that are flexible and configurable. With detailed examples available in Storybook, developers can easily understand how to implement and customize components for their needs. This library is open-source and can be freely used and modified under the MIT License.

Installation

To install the React UI Library, you can use either npm or yarn as follows:

Using npm:

npm install @oliasoft-open-source/react-ui-library

Using yarn:

yarn add @oliasoft-open-source/react-ui-library

Quick Start: React and Vite

To quickly start a new project using the React UI Library with Vite, you can use the create-vite tool, which sets up everything for you in a few simple steps:

  1. Create a New Vite Project: Use the create-vite command to scaffold a new React project. Run:

    npm create vite@latest my-new-project -- --template react

    Or with yarn

    yarn create vite my-new-project --template react
  2. Navigate into the Project Directory:

    cd my-new-project
  3. Install React UI Library: Add the React UI Library to your project:

    npm install @oliasoft-open-source/react-ui-library

    Or with yarn

     yarn add @oliasoft-open-source/react-ui-library
  4. Modify the Sample Page: Open the src/App.jsx file and import a component from the React UI Library to use it:

    import React from 'react';
    import { Text } from '@oliasoft-open-source/react-ui-library';
    
    function App() {
      return (
        <div className="App">
          <Text>Hello World!</Text>
        </div>
      );
    }
    
    export default App;
  5. Start the Development Server: Begin development by starting the Vite server:

    npm run dev

    Or with yarn

     yarn dev

Components

Storybook

To see live examples and demos of the components, please visit our Storybook.

License

This project is open-source and available under the MIT License.

Questions or Issues?

If you have any questions or encounter any issues, please open an issue on the issues page of the repository.

Components Details

Accordion Component

The Accordion component provides a versatile way to toggle visibility of content. It can be expanded to show content or collapsed to hide content, with additional options for styling and behavior customization.

Properties

Prop NameDescriptionDefault Value
headingThe content displayed in the accordion header.None (required)
expandedIf true, the accordion will be initially expanded.false
managedDetermines if the accordion's expansion state is controlled externally.false
borderedIf true, adds a border to the accordion.false
paddingIf true, adds padding inside the accordion content area.true
childrenThe content to be displayed within the accordion when it is expanded.None (optional)
onClickFunction to handle click events on the accordion header.None (optional)
squareBottomIf true, the bottom of the accordion will be square instead of rounded.false
testIdAn optional identifier used for testing.None (optional)

Usage Example

<Accordion
  heading="Section 1"
  expanded
  bordered
  onClick={() => console.log("Accordion clicked")}
>
  Content goes here
</Accordion>

AccordionWithDefaultToggle

An enhanced accordion component that includes a default toggle feature, allowing for more interactive and user-driven content display. It extends the basic functionality of an accordion by offering a built-in toggle option with customizable label and behavior.

Props

Prop NameDescriptionDefault Value
headingThe content to be displayed in the accordion header.None (required)
toggleLabelLabel for the default toggle switch.None (required)
expandedControls if the accordion is expanded or collapsed by default.false
defaultEnabledDetermines if the default toggle is enabled.true
onClickDefaultToggleFunction called when the default toggle is clicked. Receives the change event as an argument.None (optional)
paddingIf true, adds padding to the accordion content for better spacing.true
childrenThe content to be displayed inside the accordion when it is expanded.None (optional)

Usage Example

<AccordionWithDefaultToggle
  heading="Section 1"
  toggleLabel="Enable Section"
  onClickDefaultToggle={(evt) => console.log(evt.target.checked)}
  expanded
  defaultEnabled
  padding
>
  {/* Content here */}
</AccordionWithDefaultToggle>

Actions

The Actions component is designed to display a set of actions or options. It supports primary actions, subactions, icons, tooltips, and can conditionally hide or disable actions. Ideal for implementing interactive lists, toolbars, or context menus within your application.

Properties

Prop NameDescriptionTypeDefault Value (optional)
actionsArray of action items to display.IAction[]
closeLayerFunction to close the action layer. Optional.TEmpty (Function with no arguments and no return value)None

IAction Properties

Prop NameDescriptionTypeDefault Value (optional)
labelText label for the action.TStringNumberNull (String, number, or null)None
childComponentComponent to render as a child.ReactNode | (() => ReactNode)None
subActionsArray of subaction items.ISubAction[]None
primaryMarks the action as primary.booleanFalse
iconIcon to display alongside the label.ReactNodeNone
testIdIdentifier for testing purposes.stringNone
hiddenWhether the action is hidden.booleanFalse
disabledWhether the action is disabled.booleanFalse
onClickFunction to call when the action is clicked.(evt: React.MouseEvent, id?: TStringOrNumber) => voidNone
tooltipTooltip to display on hover.ReactNode | stringNone

Usage Example

<Actions
  actions={[
    {
      label: 'Action 1',
      onClick: () => console.log('Action 1 clicked'),
      primary: true,
    },
    {
      label: 'Action 2',
      onClick: () => console.log('Action 2 clicked'),
      disabled: true,
    },
    {
      label: 'Action 3',
      onClick: () => console.log('Action 3 clicked'),
      tooltip: 'This is a tooltip for Action 3',
    },
  ]}
/>

Badge

The Badge component is used to display a small badge, often used to show a count or to label an item with a short piece of text. This component can be customized with color, size, and optional dot mode for notifications or status indicators.

Properties

Prop NameDescriptionDefault Value
childrenThe content inside the badge.None (optional)
colorThe color of the badge.'' (empty string)
titleThe title or text displayed inside the badge.None (optional)
dotIf true, displays a dot instead of the children.false
marginMargin around the badge.None (optional)
smallIf true, displays a smaller version of the badge.false

Usage Example

<Badge
  color="red"
  title="New"
  dot
  margin="0 8px"
  small
>
  {/* Children here, if any */}
</Badge>

Breadcrumb Component

The Breadcrumb component displays a navigation path, typically used to show the user's location within a hierarchical structure.

Props:

Prop NameDescriptionDefault Value
linksAn array of objects representing the breadcrumb links. (See ILinkProps for details)Required
smallIf true, displays a smaller version of the breadcrumb.false

ILinkProps Interface:

This interface defines the properties for each breadcrumb link.

Prop NameDescription
typeThe type of the link (implementation-specific).Optional
labelThe text displayed for the link.Optional
urlThe URL the link points to.Optional
onClickA function to be called when the link is clicked.Optional
activeIf true, indicates the link is the current location.Optional
disabledIf true, the link is disabled and cannot be clicked.Optional
elementA React node to render instead of the default link behavior.Optional

Usage Example:

<Breadcrumb
  links={[
    { label: 'Home', url: '/' },
    { label: 'Products', url: '/products' },
    { label: 'Current Product', active: true },
  ]}
/>

Button

The Button component is a versatile interface element that supports various styles and states, including active, basic, colored, disabled, and loading states. It's suitable for a wide range of actions within an application, from form submissions to interactive commands.

Props

PropDescriptionDefault Value
activeShows the button in an active state.false
basicApplies a link-style appearance to the button.false
coloredApplies color styling. Can be boolean or string (color code or name).false
disabledIf true, disables the button.false
groupOrderSpecifies the button's position in a group (e.g., start, middle, end).None (optional)
iconAn icon to be displayed on the button. Deprecated in favor of using label.None (optional)
labelThe content of the button, which can be text or a ReactNode.None (optional)
loadingShows an activity indicator, suggesting that an action is in progress.false
nameThe name of the button, which can be used in forms.None (optional)
onClickFunction to call when the button is clicked.None (optional)
pillDeprecated. Use round for rounded corners instead.false
roundIf true, applies rounded corners to the button.false
smallIf true, displays the button in a smaller size.false
stylesCustom styles to be applied to the button.None (optional)
widthThe width of the button, can be a number or string.None (optional)
titleTooltip text for the button.None (optional)
typeThe button type (e.g., "button", "submit").button
errorDisplays an error state or message.None (optional)
warningDisplays a warning state or message.None (optional)
testIdA test identifier for the button.None (optional)
tooltipTooltip content. Can be text or a ReactNode.None (optional)
invertedDeprecated.false

Usage Example

<Button
  label="Click Me"
  onClick={() => console.log('Button clicked')}
  colored="blue"
  small
/>

ButtonGroup

The ButtonGroup component allows for the grouping of button-like elements, making it useful for presenting a selection of options or actions together. This component supports customization in terms of appearance, selection handling, and more, making it versatile for various UI scenarios.

IButtonGroupProps

PropDescriptionDefault Value
disabledIf true, disables all buttons in the group.None (optional)
basicIf true, applies a basic style to the button group.false
itemsAn array of items (strings or IBtnGroupItemProps) in the group.[]
headerAn optional header for the group.''
onSelectedCallback function triggered when an item is selected.() => {}
smallIf true, applies a smaller size to the buttons in the group.false
valueThe currently selected value.None (optional)
testIdA unique identifier for testing purposes.None (optional)

IBtnGroupItemProps

PropDescriptionDefault Value
labelThe label for the item.None (optional)
valueThe value associated with the item.None (required)
keyA unique key for the item.None (required)
hiddenIf true, the item is hidden.false
iconAn icon displayed next to the item label.None (optional)
errorDisplays an error state for the item.None (optional)
maxTooltipWidthThe maximum width of the item's tooltip.None (optional)
testIdA unique identifier for testing purposes.None (optional)
tooltipTooltip text or component for the item.None (optional)
warningDisplays a warning state for the item.None (optional)
disabledIf true, the item is disabled.false

Usage Example

<ButtonGroup
  items={[
    { label: 'Button 1', value: '1' },
    { label: 'Button 2', value: '2', disabled: true },
    { label: 'Button 3', value: '3' }
  ]}
  onSelected={(selectedValue) => console.log(selectedValue)}
/>

Card

Props

PropDescriptionDefault Value
borderedIf true, displays a border around the card.true
headingOptional heading content for the card.None (optional)
marginThe margin around the card, specified as a CSS value.'0'
paddingIf true, applies padding inside the card.true
raisedIf true, applies a box-shadow to give the card a "raised" effect.false
childrenThe content within the card.None (optional)

Usage Example

<Card heading="Card Title" raised>
  <p>This is some content within a card.</p>
</Card>

CheckBox

The CheckBox component is used to create a checkbox input field, often utilized for options that can be toggled between two states, such as true/false or yes/no. This component supports various customizations including label display, size adjustments, and integrated help text.

Props

PropDescriptionDefault Value
checkedDetermines whether the checkbox is checked.false
isInTableIf true, optimizes the checkbox for use within a table.false
labelThe text label associated with the checkbox.None (optional)
nameThe name of the checkbox input, useful for form submission.None (required)
noMarginIf true, removes the margin around the checkbox for tighter UI integration.false
onChangeA callback function that is called when the checkbox state changes.None (required)
tabIndexThe tab index of the checkbox.0
disabledIf true, disables the checkbox preventing user interaction.false
smallIf true, renders a smaller version of the checkbox.false
testIdA unique identifier for testing purposes.None (optional)
keyA unique key for rendering the component in lists.''
dataixCustom data index attribute for the component.0
valueThe value of the checkbox.None (optional)
helpTextOptional help text displayed near the checkbox.None (optional)
onClickHelpA callback function triggered when the help text is clicked.None (optional)

Usage Example

<CheckBox
  label="Accept Terms"
  name="termsAccepted"
  checked={this.state.accepted}
  onChange={e => this.setState({ accepted: e.target.checked })}
/>

Column

The Column component is a layout tool designed for creating structured, flexible column-based layouts within your application. It supports a wide range of customization options, including background color, border control, padding, and responsive width adjustments, making it an essential element for responsive design.

Props

PropDescriptionDefault Value
backgroundThe background color of the column.'transparent'
borderLeftControls the presence and style of the left border.None (optional)
borderRightControls the presence and style of the right border.None (optional)
childrenThe content to be displayed inside the column.None (optional)
flexIf true, enables flex layout for the column contents.true
flexboxIf true, the column will use flexbox layout.false
paddingControls padding inside the column. Can be boolean or string.false
scrollIf true, enables scrolling within the column.false
showScrollbarControls the visibility of the scrollbar.true
spacingControls the spacing around items inside the column.'var(--padding)'
widthThe width of the column, responsive on all devices.None (optional)
widthMobileThe column's width specifically for mobile devices.None (optional)
widthTabletThe column's width specifically for tablet devices.None (optional)
testIdA unique identifier for testing purposes.None (optional)

Usage Example

<Column
  background="lightgrey"
  borderLeft="1px solid black"
  padding="20px"
  width={100}
  widthMobile={50}
>
  {/* Column Content Here */}
</Column>

Divider

The Divider component visually separates content within your layout. It's customizable with respect to margin, color, and alignment, making it versatile for various design needs. It can be particularly useful in forms, lists, or between sections of content to provide a clear visual distinction.

Props

PropDescriptionDefault Value
marginMargin around the divider, specified as a string or number.'var(--padding)'
colorThe color of the divider line.'var(--color-border)'
alignThe alignment of the divider within its container. Options are left, center, or right.Align.CENTER
childrenThe content to display within the divider. This can be used to place text or icons in the divider line.None (optional)

Usage Example

<Divider align="center" color="grey" margin="20px">
  <Text>OR</Text>
</Divider>

Dialog

The Dialog component encapsulates a dialog box or modal's structure and behavior, providing a flexible way to display content in a floating layer above the app's main UI. This component supports a variety of content and layouts, including headers, footers, and customizable padding, making it ideal for confirmations, information dialogs, and more complex interactions.

Props

PropDescriptionDefault Value
headingThe title or heading of the dialog.None (optional)
contentThe main content of the dialog, can be a node or an array of strings.None (optional)
contentPaddingPadding inside the dialog, around the content.'var(--padding)'
footerFooter content, typically used for actions.None (optional)
widthWidth of the dialog.None (optional)
heightHeight of the dialog.None (optional)
borderedIf true, the dialog will have a border.None (optional)
onCloseFunction to call when the dialog is requested to close.None (optional)
scrollEnables scrolling within the dialog.None (optional)
testIdA test identifier for the component.None (optional)

Usage Example

<Dialog
  dialog={{
    heading: "Dialog Title",
    content: "This is the content of the dialog.",
    footer: <button onClick={() => console.log('Closing dialog')}>Close</button>,
    width: 400,
    scroll: true,
    onClose: () => console.log('Dialog closed'),
  }}
/>

Drawer

The Drawer component is a flexible and customizable sidebar or navigation drawer that slides in from the side of your application. It supports both left and right placement, fixed positioning, and the inclusion of tabs for additional organization. The drawer can be triggered to open or close programmatically, making it adaptable for various user interactions.

Props

PropDescriptionDefault Value
backgroundThe background color of the drawer.'var(--color-background-raised)'
childrenThe content displayed inside the drawer.None (optional)
fixedIf true, the drawer is fixed in position.false
openControls the open state of the drawer.false
setOpenFunction to set the open state of the drawer.None (optional)
rightIf true, the drawer slides in from the right.false
shadowIf true, the drawer casts a shadow.false
topThe distance of the drawer from the top of the viewport.0
widthThe width of the drawer when opened. Can be a single value or an array for responsive design.400
closedWidthThe width of the drawer when closed.0
buttonOptional button to toggle the drawer. Can be boolean or a ReactNode for custom button.None (optional)
buttonAnimateIf true, the toggle button animates on state change.true
buttonPositionPosition of the toggle button.ButtonPosition.BOTTOM
borderIf true, adds a border to the drawer. Can be a boolean or a string for custom border styles.false
tabsArray of tabs for organizing content within the drawer.None (optional)
defaultTabIndexThe index of the tab to be selected by default.0
activeTabControls the active tab state.None (optional)
setActiveTabFunction to set the active tab.None (optional)
testIdA unique identifier for testing purposes.None (optional)
onResizeCallback function that is called when the drawer is resized.None (optional)
getActiveTabFunction that receives the active tab information.None (optional)
onCloseCallback function that is called when the drawer is closed.None (optional)
onOpenCallback function that is called when the drawer is opened.None (optional)

Usage Example

<Drawer
  open={true}
  right
  width="250px"
  onClose={() => console.log("Drawer closed")}
>
  {/* Content here */}
</Drawer>

Empty

The Empty component is a useful UI element for displaying a state where there is no data or content available. It can be customized with specific dimensions and text, making it adaptable to various scenarios where you might need to inform users that a section or area is intentionally empty.

Props

PropDescriptionDefault Value
widthThe width of the empty state container.'auto'
heightThe height of the empty state container.'auto'
textThe text or ReactNode displayed in the empty state.'No data'
childrenChildren elements to be rendered inside the empty state container.None (optional)
testIdA unique identifier for testing purposes.None (optional)

Usage Example

<Empty
  width={300}
  height={200}
  text="No items found."
>
  <Button>Refresh</Button>
</Empty>

FileInput

The FileInput component allows users to select files from their device storage. It supports single and multiple file selections, customizable via props. This component is ideal for forms requiring file uploads, offering options for file type acceptance, loading states, and accessibility features.

Props

PropDescriptionDefault Value
labelThe label displayed on the file input.'Select'
loadingDisplays a loading state if set to true.false
placeholderText displayed when no file is selected.'No file selected'
disabledIf true, disables the file input.false
fileThe currently selected file.None (optional)
acceptDefines the file types the file input should accept.None (optional)
multiAllows multiple files to be selected if set to true.None (optional)
nameThe name attribute of the input element.None (optional)
widthThe width of the file input.None (optional)
onChangeCallback function called when the selected file changes.None (optional)
testIdA test identifier for the component.None (optional)

Usage Example

<FileInput
  label="Upload Document"
  accept=".pdf"
  multi
  onChange={(evt) => console.log(evt.target.files)}
/>

Field

The Field component serves as a container for form elements, providing a structured layout for labels, input fields, help text, and additional features like lock icons or information tooltips.

Props

PropDescriptionDefault Value
labelThe label for the field.None
labelLeftIf true, aligns the label to the left.false
labelWidthThe width of the label.'auto'
childrenThe content of the field, typically an input component.None (required)
helpTextAdditional text to assist users with the field.None
helpTextMaxWidthThe maximum width of the help text.'300px'
onClickHelpA callback function triggered when the help text is clicked.() => {}
lockConfiguration for a lock icon.{ visible: false, active: false, onClick: () => {}, tooltip: '', testId: undefined }
infoAdditional information displayed alongside the field.''
libraryIconConfiguration for an icon from a library.None
testIdA unique identifier for testing purposes.-

Usage Example

<Field
  label="Username"
  helpText="Choose a unique username"
  info="Your username must be at least 6 characters long."
>
  <Input placeholder="Enter your username" />
</Field>

Flex

The Flex component enables flexible layout arrangements by providing properties to control the alignment, direction, and spacing of its children elements.

Props

PropDescriptionDefault Value
alignItemsThe alignment of flex items along the cross axis.'initial'
justifyContentThe alignment of flex items along the main axis.'initial'
directionThe direction of the flex container's main axis.'initial'
heightThe height of the flex container.'initial'
childrenThe child elements of the flex container.null
wrapIf true, allows flex items to wrap onto multiple lines.true
gapThe gap between flex items.false

Usage Example

<Flex alignItems="center" justifyContent="space-between" direction="row" gap={10}>
  <div>Item 1</div>
  <div>Item 2</div>
  <div>Item 3</div>
</Flex>

FormRow

The FormRow component is used to group form elements together in a row layout.

Props

PropDescriptionDefault Value
childrenThe child elements of the form row.null

Usage Example

<FormRow>
  <Input label="Username" />
  <Button label="Submit" onClick={handleSubmit} />
</FormRow>

Grid

The Grid component allows you to create a grid layout with specified rows and columns.

Props

PropDescriptionDefault Value
rowsThe CSS value for defining the grid rows'initial'
columnsThe CSS value for defining the grid columns'initial'
columnsTabletThe CSS value for defining grid columns on tabletsnull
columnsMobileThe CSS value for defining grid columns on mobilesnull
gapWhether to include gap between grid itemsfalse
heightThe CSS value for defining the grid height'initial'
childrenThe child elements of the gridnull

Usage Example

<Grid rows="auto" columns="repeat(3, 1fr)" gap={20}>
  <GridItem>Item 1</GridItem>
  <GridItem>Item 2</GridItem>
  <GridItem>Item 3</GridItem>
</Grid>

Icon

The Icon component is a wrapper used to render various types of icons within your application.

Props

PropDescriptionDefault Value
iconThe icon to be rendered. This can be a ReactNode, string name, or SVG.
onClickThe callback function triggered when the icon is clicked.-
clickableDetermines whether the icon is clickable or not.false
colorThe color of the icon.-
sizeThe size of the icon.-
testIdA test id for identification in automated tests.-

Usage Example

<Icon icon="search" color="blue" size={24} />

In this example, the Icon component renders an icon with the name "search", colored blue, and sized at 24 pixels.

  • The icon prop accepts various formats such as string names, React components, or SVG elements.
  • If using a string name, it's recommended to use icon libraries like Font Awesome or Material Icons.
  • When providing a custom SVG, ensure it's properly formatted and compatible with React's rendering.
  • Setting the clickable prop to true adds cursor pointer and hover effects to the icon.
<Icon icon={<CustomIcon />} clickable onClick={handleIconClick} />

InputGroup

The InputGroup component is used to group together multiple input elements or components.

Props

PropDescriptionDefault Value
childrenThe input elements or components to be grouped.
smallDetermines whether the input group is small or not.false
widthThe width of the input group.'100%'

Usage Example

<InputGroup>
  <Input placeholder="Username" />
  <Button>Search</Button>
</InputGroup>

InputGroupAddon

The InputGroupAddon component is used to add additional content or components to an InputGroup.

Props

PropDescriptionDefault Value
childrenThe content or components to be added to the input group.
groupOrderThe order of the addon within the input group.null
smallDetermines whether the addon is small or not.false

Usage Example

<InputGroup>
  <InputGroupAddon>$</InputGroupAddon>
  <Input placeholder="Amount" />
</InputGroup>

HelpIcon

The HelpIcon component provides an icon with optional tooltip text to offer assistance or additional information.

Props

PropDescriptionDefault Value
textThe text or content to display in the tooltip.
onClickA function to be called when the icon is clicked.
iconThe icon to display. It can be a ReactNode or a string representing an icon (e.g., "help", "info").'help'
activeDetermines whether the icon is in an active state.false
maxWidthThe maximum width of the tooltip.'300px'
testIdThe test ID for identifying the component in tests.

Usage Example

<HelpIcon text="Click here for more information" />

Heading

The Heading component renders a heading element with optional features such as help text and an icon.

Props

PropDescriptionDefault Value
childrenThe content to be rendered within the heading element.
helpTextAdditional text or content to provide assistance or information about the heading.
onClickA function to be called when the heading is clicked.
onClickHelpA function to be called when the help text is clicked.
onIconClickA function to be called when the icon is clicked.
iconThe icon element to be displayed alongside the heading.
libraryIconConfiguration for the library icon, containing an onClick function and an optional tooltip text.
marginBottomThe margin at the bottom of the heading.
topDetermines whether the heading is displayed at the top of the container.false
testIdThe test ID for identifying the component in tests.

Usage Example

<Heading>Page Title</Heading>
<Heading
  top={true}
  onClick={() => console.log('Heading clicked')}
  helpText="This is the main title of the page"
  onClickHelp={() => console.log('Help text clicked')}
  icon={<QuestionCircleOutlined />}
  libraryIcon={{ onClick: () => console.log('Library icon clicked'), tooltip: 'More info' }}
  marginBottom="10px"
>
  Page Title
</Heading>

Input

The Input component provides an input field for users to enter data. It supports various features such as error and warning messages, tooltips, and custom event handlers.

Props

PropDescriptionDefault Value
errorError message or content to indicate validation errors.null
warningWarning message or content to indicate potential issues.null
tooltipAdditional information or context provided as a tooltip.null
nameThe name attribute of the input field.-
typeThe type of input field (e.g., text, number, email).'text'
onChangeEvent handler called when the input value changes.() => {}
onKeyPressEvent handler called when a key is pressed while the input is focused.() => {}
onFocusEvent handler called when the input is focused.() => {}
onBlurEvent handler called when the input loses focus.() => {}
onPasteEvent handler called when content is pasted into the input field.() => {}
smallDetermines whether to render a smaller-sized input field.false
placeholderPlaceholder text displayed when the input is empty.''
tabIndexThe tab index of the input field.0
valueThe value of the input field.''
disabledDetermines whether the input field is disabled.false
rightDetermines whether to align content to the right of the input field.false
groupOrderPosition of the input field within a group or sequence.null
maxTooltipWidthThe maximum width of the tooltip.-
testIdTest ID for identifying the component in tests.-
sizeDeprecated. Use width instead to define the size of the input field.null
isInTableSpecifies whether the input is used within a table.false
widthWidth of the input field.-

Usage Example

<Input
  type="text"
  placeholder="Enter your name"
  value={name}
  onChange={(e) => setName(e.target.value)}
  error={nameError}
  tooltip="Please enter your full name"
  disabled={isDisabled}
/>
<Input
  type="number"
  placeholder="Enter your age"
  value={age}
  onChange={(e) => setAge(e.target.value)}
  warning={ageWarning}
/>

Label

The Label component represents a label or caption associated with an input field or other form elements. It can include optional elements such as help text, lock icons, and library icons.

Props

PropDescriptionDefault Value
labelThe text or content of the label.null
widthThe width of the label.'auto'
helpTextHelp text or additional information associated with the label.''
helpTextMaxWidthThe maximum width of the help text.'300px'
onClickHelpEvent handler called when the help icon or text is clicked.-
lockConfiguration for the lock icon displayed with the label.See below
libraryIconConfiguration for the library icon displayed with the label.-
labelLeftDetermines whether to align the label to the left side.false
infoAdditional information or tooltip associated with the label.-

Lock Props:

PropDescriptionDefault Value
visibleDetermines whether the lock icon is visible.false
activeDetermines whether the lock icon is active.false
onClickEvent handler called when the lock icon is clicked.() => {}
tooltipTooltip text displayed when hovering over the icon.''
testIdTest ID for identifying the lock icon in tests.-

Usage Example

<Label
  label="Username"
  helpText="Enter your username"
  onClickHelp={() => console.log('Help clicked')}
  lock={{
    visible: true,
    active: false,
    onClick: () => console.log('Lock clicked'),
    tooltip: 'Locked',
  }}
  libraryIcon={{
    onClick: () => console.log('Library icon clicked'),
    tooltip: 'Open library',
  }}
/>

List

The List component renders a list of data items with various customization options such as borders, expanding items, and draggable rows.

Props

PropDescriptionDefault Value
drawerSpecifies whether the list is rendered as a drawer.false
listThe data to be displayed in the list.Required
borderedDetermines whether the list items have borders.false
expandingSpecifies whether the list items can be expanded to show additional content.false
narrowDetermines whether the list items have a narrower layout.false
toggleNarrowSpecifies whether to enable toggling the narrow mode.false
onToggleNarrowCallback function called when toggling the narrow mode.() => {}
invokeEditOnRowClickDetermines whether clicking on a row invokes editing mode.true
noHeaderSpecifies whether to hide the header of the list.false
stickyHeaderDetermines whether the list header sticks to the top when scrolling.-
draggableSpecifies whether the list items can be dragged to reorder.false
onListReorderCallback function called when reordering the list items.() => {}
marginBottomThe margin bottom applied to the list.0
heightThe height of the list.-
testIdTest ID for identifying the list component.-
scrollDetailsConfiguration for scrolling behavior and infinite scroll functionality. See details below.See details below

Scroll Details:

PropDescriptionDefault Value
scrollableDetermines whether the list is scrollable.false
hideScrollbarDetermines whether to hide the scrollbar when scrolling.false
triggerScrollToActiveItemSpecifies whether scrolling should be triggered to display the active item.false
infiniteScrollSpecifies whether to enable infinite scroll functionality.false
limitThe limit of items to load per page when using infinite scroll.10
infiniteScrollTargetThe target element for infinite scroll (e.g., the list container).-

Usage Example

<List
  list={myData}
  bordered
  expanding
  draggable
  stickyHeader
  marginBottom={20}
  height={300}
  testId="my-list"
  scrollDetails={{
    scrollable: true,
    hideScrollbar: true,
    triggerScrollToActiveItem: true,
    infiniteScroll: true,
    limit: 10,
    infiniteScrollTarget: document.getElementById('list-container'),
  }}
/>

ListHeading

The ListHeading component represents the header of a list. It typically includes the name or title of the list and optional actions.

Props

PropDescriptionDefault Value
nameThe name or title of the list.Required
actionsAn array of action items to be displayed in the header.[]
toggleNarrowSpecifies whether to enable toggling the narrow mode for the list.false
onToggleNarrowCallback function called when toggling the narrow mode.() => {}
stickyHeaderDetermines whether the list header sticks to the top when scrolling.-

Usage Example

<ListHeading
  name="My List"
  actions={[{ label: 'Add', onClick: handleAdd }, { label: 'Edit', onClick: handleEdit }]}
  toggleNarrow
  onToggleNarrow={handleToggleNarrow}
  stickyHeader
/>

ListSubheading

The ListSubheading component represents a subheading within a list. It is typically used to provide additional information or context for a group of items within the list.

Props

PropDescriptionDefault Value
itemAn object containing data for the subheading item.Required
indexThe index of the subheading item within the list.-

Usage Example

<ListSubheading item={{ label: 'Group A', count: 5 }} index={0} />

Loader

The Loader component renders a loading indicator, typically used to indicate that content is being fetched or processed.

Props

PropDescriptionDefault Value
widthThe width of the loader.
heightThe height of the loader.
textThe text to display alongside the loader.'' (empty)
detailsAdditional details or information to display below the loader.'' (empty)
fullViewPortSizeA boolean indicating whether the loader should cover the entire viewport.false
coverA boolean indicating whether the loader should cover its parent element.false
childrenAdditional React elements to render alongside the loader.null
themeThe theme of the loader. This can be either Theme.DARK or Theme.LIGHT.Theme.DARK
testIdA string value representing the test ID for testing purposes.null

Usage Example

<Loader text="Loading..." cover />

Menu

The Menu component is used to render a menu with various options or sections.

Props

PropDescriptionDefault Value
menuAn object containing properties for configuring the menu.{}
contextMenuA boolean indicating whether the menu is a context menu.false
widthThe width of the menu.
4.4.4

20 hours ago

4.4.3

7 days ago

4.4.1

16 days ago

4.4.2

16 days ago

4.4.0

17 days ago

4.3.2

22 days ago

4.3.2-beta-1

23 days ago

4.3.1

25 days ago

4.3.1-beta-1

25 days ago

4.3.0

28 days ago

4.2.9-beta-1

1 month ago

4.2.7

2 months ago

4.2.8

2 months ago

4.2.5

2 months ago

4.2.6

2 months ago

4.2.5-beta-1

2 months ago

4.2.4

2 months ago

4.2.3

2 months ago

4.2.3-beta-5

2 months ago

4.2.3-beta-2

2 months ago

4.2.3-beta-4

2 months ago

4.2.3-beta-3

2 months ago

4.2.2

2 months ago

4.2.3-beta-1

2 months ago

4.3.0-beta-2

2 months ago

4.3.0-beta-1

2 months ago

4.2.1

2 months ago

4.2.1-beta-2

2 months ago

4.2.1-beta-1

2 months ago

4.2.0-beta-3

2 months ago

4.2.0-beta-2

2 months ago

4.2.0-beta-1

2 months ago

4.2.0

2 months ago

4.1.11

3 months ago

4.1.11-beta-1

3 months ago

4.1.11-beta-2

3 months ago

4.1.10

3 months ago

4.1.10-beta-1

3 months ago

4.1.10-beta-2

3 months ago

4.1.9

3 months ago

4.1.8

3 months ago

4.1.7

3 months ago

4.1.6

3 months ago

4.1.6-beta-1

3 months ago

4.1.4

3 months ago

4.1.5

3 months ago

4.1.3

4 months ago

4.1.2

4 months ago

4.1.1

4 months ago

4.1.0

4 months ago

4.0.2

4 months ago

4.0.1

4 months ago

4.0.0

4 months ago

4.0.0-beta-76

4 months ago

4.0.0-beta-74

4 months ago

4.0.0-beta-73

4 months ago

4.0.0-beta-75

4 months ago

4.0.0-beta-72

4 months ago

3.15.2

4 months ago

4.0.0-beta-70

4 months ago

4.0.0-beta-71

4 months ago

4.0.0-beta-69

4 months ago

4.0.0-beta-67

4 months ago

4.0.0-beta-68

4 months ago

3.15.1-beta-1

5 months ago

3.15.0

5 months ago

3.15.1

5 months ago

4.0.0-beta-66

5 months ago

4.0.0-beta-65

5 months ago

3.14.2-beta-1

5 months ago

3.14.1

5 months ago

3.14.3

5 months ago

3.14.2

5 months ago

4.0.0-beta-63

5 months ago

4.0.0-beta-62

5 months ago

4.0.0-beta-64

5 months ago

4.0.0-beta-61

5 months ago

4.0.0-beta-60

5 months ago

3.14.0

5 months ago

4.0.0-beta-59

5 months ago

3.9.11-beta-1

10 months ago

3.9.11-beta-2

10 months ago

3.9.11-beta-3

10 months ago

3.11.2-beta-1

7 months ago

3.13.9

6 months ago

3.12.0-beta-8

7 months ago

3.12.0-beta-9

7 months ago

3.12.0-beta-6

7 months ago

3.12.0-beta-7

7 months ago

3.13.2

6 months ago

3.12.0-beta-4

7 months ago

3.13.1

6 months ago

3.12.0-beta-5

7 months ago

3.13.4

6 months ago

3.12.0-beta-2

7 months ago

3.13.3

6 months ago

3.12.0-beta-3

7 months ago

3.13.6

6 months ago

3.13.5

6 months ago

3.12.0-beta-1

7 months ago

3.13.8

6 months ago

3.13.7

6 months ago

3.12.1

6 months ago

3.12.0

6 months ago

3.13.6-beta-1

6 months ago

3.13.6-beta-2

6 months ago

3.13.0

6 months ago

3.13.1-beta-1

6 months ago

3.11.0-beta-4

8 months ago

3.9.17

9 months ago

3.11.0-beta-3

8 months ago

3.9.18

9 months ago

3.11.0-beta-2

8 months ago

3.9.15

9 months ago

3.11.0-beta-1

8 months ago

3.9.16

9 months ago

3.9.13

9 months ago

3.9.14

9 months ago

3.9.11

10 months ago

3.9.12

9 months ago

3.11.0-beta-9

8 months ago

3.11.0-beta-8

8 months ago

3.11.0-beta-7

8 months ago

3.11.0-beta-6

8 months ago

3.9.19

9 months ago

3.11.0-beta-5

8 months ago

3.9.9

10 months ago

3.11.4

7 months ago

3.9.10

10 months ago

3.11.6

7 months ago

3.11.5

7 months ago

3.11.8

7 months ago

3.11.7

7 months ago

3.11.9

7 months ago

3.10.1

8 months ago

3.10.0

8 months ago

3.10.3

8 months ago

3.9.22

8 months ago

3.10.2

8 months ago

3.9.23

8 months ago

3.9.20

8 months ago

3.9.21

8 months ago

4.0.0-beta-7

7 months ago

4.0.0-beta-6

7 months ago

3.12.0-beta-46

6 months ago

4.0.0-beta-5

8 months ago

3.11.0-beta-19

8 months ago

4.0.0-beta-4

8 months ago

3.11.0-beta-18

8 months ago

3.11.0-beta-17

8 months ago

4.0.0-beta-3

8 months ago

3.11.0-beta-16

8 months ago

4.0.0-beta-2

8 months ago

3.11.0-beta-15

8 months ago

4.0.0-beta-1

8 months ago

3.11.0-beta-14

8 months ago

3.12.0-beta-40

6 months ago

3.11.0-beta-13

8 months ago

3.12.0-beta-41

6 months ago

3.11.0-beta-12

8 months ago

3.11.0-beta-11

8 months ago

3.11.0-beta-10

8 months ago

3.12.0-beta-44

6 months ago

3.12.0-beta-45

6 months ago

3.12.0-beta-42

6 months ago

4.0.0-beta-9

7 months ago

3.12.0-beta-43

6 months ago

4.0.0-beta-8

7 months ago

3.12.0-beta-37

6 months ago

3.12.0-beta-38

6 months ago

3.12.0-beta-35

6 months ago

3.12.0-beta-36

6 months ago

4.0.0-beta-56

5 months ago

3.11.0

8 months ago

4.0.0-beta-55

5 months ago

4.0.0-beta-58

5 months ago

3.12.0-beta-39

6 months ago

3.11.2

7 months ago

4.0.0-beta-57

5 months ago

3.11.1

7 months ago

4.0.0-beta-52

5 months ago

4.0.0-beta-51

5 months ago

4.0.0-beta-54

5 months ago

4.0.0-beta-53

5 months ago

3.10.5-beta-1

8 months ago

4.0.0-beta-50

6 months ago

3.10.3-beta-1

8 months ago

3.10.1-beta-1

8 months ago

3.12.0-beta-30

6 months ago

3.12.0-beta-33

6 months ago

3.11.0-beta-20

8 months ago

3.12.0-beta-34

6 months ago

3.12.0-beta-31

6 months ago

3.12.0-beta-32

6 months ago

4.0.0-beta-49

6 months ago

3.12.0-beta-26

7 months ago

4.0.0-beta-48

6 months ago

3.12.0-beta-27

7 months ago

3.12.0-beta-24

7 months ago

3.12.0-beta-25

7 months ago

4.0.0-beta-45

6 months ago

4.0.0-beta-44

6 months ago

4.0.0-beta-47

6 months ago

3.12.0-beta-28

6 months ago

3.9.15-beta-1

9 months ago

4.0.0-beta-46

6 months ago

3.12.0-beta-29

6 months ago

4.0.0-beta-41

6 months ago

4.0.0-beta-40

6 months ago

4.0.0-beta-43

6 months ago

4.0.0-beta-42

6 months ago

3.12.0-beta-23

7 months ago

3.12.0-beta-20

7 months ago

3.12.0-beta-21

7 months ago

4.0.0-beta-38

6 months ago

3.12.0-beta-15

7 months ago

4.0.0-beta-37

7 months ago

3.12.0-beta-16

7 months ago

3.12.0-beta-13

7 months ago

4.0.0-beta-39

6 months ago

3.12.0-beta-14

7 months ago

3.12.0-beta-19

7 months ago

4.0.0-beta-34

7 months ago

4.0.0-beta-33

7 months ago

4.0.0-beta-36

7 months ago

3.12.0-beta-17

7 months ago

4.0.0-beta-35

7 months ago

3.12.0-beta-18

7 months ago

3.13.10

6 months ago

4.0.0-beta-30

7 months ago

3.13.11

6 months ago

3.13.12

6 months ago

4.0.0-beta-32

7 months ago

3.13.13

5 months ago

4.0.0-beta-31

7 months ago

3.13.14

5 months ago

3.13.15

5 months ago

3.13.16

5 months ago

3.12.0-beta-11

7 months ago

3.12.0-beta-12

7 months ago

3.11.6-beta-1

7 months ago

3.12.0-beta-10

7 months ago

3.11.6-beta-2

7 months ago

4.0.0-beta-27

7 months ago

4.0.0-beta-26

7 months ago

4.0.0-beta-29

7 months ago

3.9.18-beta-1

9 months ago

3.9.10-beta-2

10 months ago

4.0.0-beta-28

7 months ago

3.9.10-beta-1

10 months ago

4.0.0-beta-23

7 months ago

4.0.0-beta-22

7 months ago

4.0.0-beta-25

7 months ago

4.0.0-beta-24

7 months ago

4.0.0-beta-21

7 months ago

4.0.0-beta-20

7 months ago

3.10.4

8 months ago

3.9.12-beta-1

10 months ago

4.0.0-beta-15

7 months ago

4.0.0-beta-18

7 months ago

4.0.0-beta-17

7 months ago

4.0.0-beta-12

7 months ago

4.0.0-beta-11

7 months ago

4.0.0-beta-14

7 months ago

4.0.0-beta-13

7 months ago

4.0.0-beta-10

7 months ago

3.13.0-beta-4

6 months ago

3.13.0-beta-3

6 months ago

3.13.0-beta-6

6 months ago

3.13.0-beta-5

6 months ago

3.13.0-beta-2

6 months ago

3.13.0-beta-1

6 months ago

4.0.0-beta-19

7 months ago

3.9.13-beta-1

9 months ago

3.11.1-beta-11

8 months ago

3.11.1-beta-10

8 months ago

3.13.17-beta-1

5 months ago

3.13.17-beta-2

5 months ago

3.11.1-beta-4

8 months ago

3.11.1-beta-5

8 months ago

3.11.1-beta-2

8 months ago

3.11.1-beta-3

8 months ago

3.11.1-beta-1

8 months ago

3.11.1-beta-8

8 months ago

3.11.1-beta-9

8 months ago

3.11.1-beta-6

8 months ago

3.11.1-beta-7

8 months ago

3.11.11

6 months ago

3.11.10

6 months ago

3.11.13

6 months ago

3.10.2-beta-1

8 months ago

3.11.12

6 months ago

3.10.4-beta-1

8 months ago

3.11.14

6 months ago

3.10.0-beta-1

9 months ago

3.10.0-beta-2

8 months ago

3.9.8

10 months ago

3.9.7

10 months ago

3.9.6

10 months ago

3.9.5

10 months ago

3.9.4

10 months ago

3.5.3-beta-1

12 months ago

3.6.2

11 months ago

3.6.1-beta-1

11 months ago

3.6.1

11 months ago

3.6.0

11 months ago

3.9.2-beta-4

11 months ago

3.9.2-beta-2

11 months ago

3.9.2-beta-3

11 months ago

3.9.2-beta-1

11 months ago

3.6.5

11 months ago

3.6.4

11 months ago

3.6.3

11 months ago

3.5.3

12 months ago

3.5.2

12 months ago

3.5.1

12 months ago

3.5.0

12 months ago

3.9.3

11 months ago

3.9.2

11 months ago

3.5.6

11 months ago

3.9.1

11 months ago

3.5.5

11 months ago

3.9.0

11 months ago

3.5.4

11 months ago

3.4.0

12 months ago

3.8.0

11 months ago

3.4.2

12 months ago

3.4.1

12 months ago

3.8.1

11 months ago

3.7.0

11 months ago

3.3.20

1 year ago

3.3.21

12 months ago

3.3.22

12 months ago

3.3.23

12 months ago

3.3.9

1 year ago

3.3.8

1 year ago

3.3.7

1 year ago

3.3.6

1 year ago

3.3.11-beta-1

1 year ago

3.3.8-beta-1

1 year ago

3.3.13

1 year ago

3.3.14

1 year ago

3.3.15

1 year ago

3.3.16

1 year ago

3.3.17

1 year ago

3.3.18

1 year ago

3.2.7-beta-3

1 year ago

3.3.19

1 year ago

3.3.10

1 year ago

3.3.11

1 year ago

3.3.12

1 year ago

3.3.1

1 year ago

3.3.5

1 year ago

3.3.4

1 year ago

3.3.3

1 year ago

3.3.2

1 year ago

3.2.0-beta-1

1 year ago

3.2.0-beta-2

1 year ago

3.2.2

1 year ago

3.2.1

1 year ago

3.3.0-beta-1

1 year ago

3.2.0

1 year ago

3.2.6

1 year ago

3.1.27

1 year ago

3.2.5

1 year ago

3.1.26

1 year ago

3.2.4

1 year ago

3.1.29-beta-0

1 year ago

3.1.29

1 year ago

3.2.3

1 year ago

3.1.28

1 year ago

3.3.0-beta-3

1 year ago

3.3.0-beta-2

1 year ago

3.2.7-beta-2

1 year ago

3.2.7-beta-1

1 year ago

3.3.0

1 year ago

3.1.12

1 year ago

3.1.11

1 year ago

3.1.14

1 year ago

3.1.13

1 year ago

3.1.16

1 year ago

3.1.15

1 year ago

3.1.18

1 year ago

3.1.17

1 year ago

3.1.20-beta1

1 year ago

3.1.10

1 year ago

3.1.9

1 year ago

3.1.8

1 year ago

3.1.23

1 year ago

3.1.22

1 year ago

3.1.25

1 year ago

3.1.24

1 year ago

3.1.21

1 year ago

3.1.20

1 year ago

3.1.19

1 year ago

3.1.3

1 year ago

3.1.2

1 year ago

3.1.7

1 year ago

3.1.6

1 year ago

3.1.5

1 year ago

3.1.4

1 year ago

2.4.10

1 year ago

2.4.12

1 year ago

2.4.11

1 year ago

3.0.4

1 year ago

3.0.3

1 year ago

3.1.1

1 year ago

3.0.2

1 year ago

3.1.0

1 year ago

3.0.1

1 year ago

3.0.6

1 year ago

3.0.5

1 year ago

2.4.9

1 year ago

3.0.0

1 year ago

2.4.8

1 year ago

2.4.7

1 year ago

2.4.6

1 year ago

2.4.5

2 years ago

2.4.4

2 years ago

2.4.3

2 years ago

2.4.2

2 years ago

2.4.1

2 years ago

2.4.0

2 years ago

2.3.5

2 years ago

2.3.4

2 years ago

2.3.3

2 years ago

2.3.2

2 years ago

2.3.1

2 years ago

2.3.0

2 years ago

2.2.2

2 years ago

2.2.1

2 years ago

2.2.0

2 years ago

2.1.0

2 years ago

2.0.0

2 years ago

1.0.0

2 years ago