Documentation index for AI agents (llms.txt). Markdown versions of every page are available by appending .md to the page URL. The full corpus is at /llms-full.txt.

Password

The Password component wraps the Cherry Input with type="password" and adds a show/hide reveal toggle pinned inside the field.

It accepts every Input property except type, $icon, and $iconPosition: type is owned by the component to flip between masked and plain text, and the icon slot is reserved for the reveal button. Small fields automatically get a matching small reveal button.

Keep in mind that the <input> element inherently includes native browser properties like onChange. Cherry UI components introduce custom properties that always begin with a $ to distinguish them from native props.

For design guidelines and all interactive states, see the Inputs design page.

import React from "react";
import { Password } from "cherry-styled-components";

export default function Page() {
  return <Password $label="Password" $fullWidth id="password" />;
}

With sizes and validation states:

<Password $size="big" $fullWidth />
<Password $error $fullWidth />

Properties

$labelstring

Label text displayed above the input.

$size"default" | "big" | "small"

Size of the input. The small size also shrinks the reveal button.

$errorboolean

Shows error state styling on the field and the reveal button.

$successboolean

Shows success state styling.

$fullWidthboolean

Makes the input span the full width of its container.

$wrapperClassNamestring

Class name applied to the wrapper element around the input, for restyling from the outside.

The reveal toggle manages aria-pressed and swaps its accessible label between "Show password" and "Hide password" automatically.