mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-20 12:23:02 +00:00
38 lines
1 KiB
Text
38 lines
1 KiB
Text
<script>
|
|
import { PasswordInput } from "carbon-components-svelte";
|
|
import Preview from "../../components/Preview.svelte";
|
|
</script>
|
|
|
|
### Default
|
|
|
|
<PasswordInput labelText="Password" placeholder="Enter password..." />
|
|
|
|
### Password is visible
|
|
|
|
Set prop `type` to `"text"` to toggle password visibility.
|
|
|
|
<PasswordInput labelText="Password" type="text" placeholder="Enter password..." value="as_lta0890sdfpo__!9901" />
|
|
|
|
### Hidden label
|
|
|
|
<PasswordInput hideLabel labelText="Password" placeholder="Enter password..." />
|
|
|
|
### Light variant
|
|
|
|
<PasswordInput light labelText="Password" placeholder="Enter password..." />
|
|
|
|
### Extra-large size
|
|
|
|
<PasswordInput size="xl" labelText="Password" placeholder="Enter password..." />
|
|
|
|
### Small size
|
|
|
|
<PasswordInput size="sm" labelText="Password" placeholder="Enter password..." />
|
|
|
|
### Invalid state
|
|
|
|
<PasswordInput invalid invalidText="Incorrect user name or password." labelText="Password" placeholder="Enter password..." />
|
|
|
|
### Disabled state
|
|
|
|
<PasswordInput disabled labelText="Password" placeholder="Enter password..." />
|