--- title: "Input Group" pageTitle: "Fylgja Input Group" description: "Create smarter, more intuitive form controls by grouping inputs and buttons together" npm: "@fylgja/input-group" git: "https://github.com/fylgja/fylgja/tree/main/components/input-group" sortOrder: 11 --- The Fylgja Input Group component allows you to group inputs and buttons together to create more intuitive form controls. This component is ideal for building various UI elements such as search bars, button groups, or rating systems using radio buttons. ## Installation You can install Fylgja Input Group via npm or other Node-based package managers like pnpm or bun: ```sh npm install @fylgja/input-group ``` Alternatively, you can use it directly via a CDN: ```html ``` ## Usage Once installed, you can import the full package with: ```css @import "@fylgja/input-group"; ``` Alternatively, if you only need specific parts, you can import them individually: | Import Path | Description | | --------------------------- | ------------------------------------- | | `@fylgja/input-group/base` | Contains to core of the Input Group | | `@fylgja/input-group/merge` | Contains the `--merge` modifier class | | `@fylgja/input-group/steps` | Contains the `--steps` modifier class | ## Modifiers ### `--merge` The `--merge` modifier merges all borders between elements in an input group, making them appear as a unified component. ### `--steps` The `--steps` modifier adds stepping functionality, mainly used with radio buttons or checkbox groups to create a range-like input. ## Examples These examples demonstrate how you can use the Input Group component with various form controls and modifiers. The flexibility of this component allows you to customize form elements easily. ### Search box Create a simple search bar by combining an input field with a button:
```html
``` ### Button Group Create a group of buttons with the `--merge` modifier for a seamless design:
```html
``` You can also use checkboxes to create a toolbar. The btn class hides the input and makes the label the interactive element: ```html
``` ### Start Rating Use the `--steps` modifier to create a rating system with radio buttons, giving it the appearance of a step-by-step input:
Your Rating
```html
Your Rating
...
```