Input Group
Input with optional prefix and suffix addons (e.g. icon, currency, domain)
Same BEM classes and behavior as Astro, Svelte, and React.
Add this component
Run the command below in your project directory. When prompted, select the component(s) you want. The CLI will copy the CSS and component files.
Choose your package manager — click a tab to select, then copy the command.
Live examples
Usage
Usage
Full example for each framework (Astro, Vanilla, Svelte, Vue, React). Switch framework via View as or by clicking a Usage tab—both stay in sync.
Astro Vanilla Svelte Vue React ---
import InputGroup from '../components/astro/InputGroup.astro';
---
<InputGroup prefix="$" suffix="USD" placeholder="0.00" ariaLabel="Amount" />
<!-- Rizzo CSS. Ensure input has accessible name (aria-label or associated label). -->
<div class="input-group">
<span class="input-group__prefix" aria-hidden="true">$</span>
<input type="text" class="input-group__input" placeholder="0.00" aria-label="Amount" />
<span class="input-group__suffix" aria-hidden="true">USD</span>
</div>
<script>
import { InputGroup } from '$lib/rizzo';
</script>
<InputGroup prefix="$" suffix="USD" placeholder="0.00" ariaLabel="Amount" />
<script setup>
import InputGroup from '@/components/rizzo/InputGroup.vue';
</script>
<template>
<InputGroup aria-label="Amount" placeholder="0.00">
<template #prefix>$</template>
<template #suffix>USD</template>
</InputGroup>
</template>
import { InputGroup } from './components/react';
<InputGroup prefix="$" suffix="USD" placeholder="0.00" ariaLabel="Amount" />
Other frameworks: Astro · Vanilla · Svelte · React