Skip to content

IP Address Input

Pro

A field for an IPv4 address. It takes only digits and dots, adds a dot after 3 digits, and checks that each of the 4 parts is 0 to 255.

  • React 19
  • Tailwind CSS 4

Added Nov 9, 2026 · Pro license

Playground

Loading the preview

Props

Needs your Pro API key in GELATIN_UI_PRO_TOKEN. Set it up

Pro itemAPI key required

IP Address Input needs a Pro API key

Try the live preview for free. With Pro, the add command above puts the source in your project.

Files it adds
23
More Pro items, one API key
+327
Your coding agent runs it
1 cmd

$79$129once, for life

Already have Pro? Sign in to set up your API key.

Put the icon and the control in the input, inside a Field with a label and a description.

The sample also uses Field. One command adds them with this item:

allowed-ip.tsx

IpAddressInput

<div>
PropTypeDefaultDescription
classNamestring—
rounded"default""full""default"
size"default""lg""sm""xs""default"
variant"dashed""default"—
disabledbooleanfalseTurns the control off; the frame fades to 50% with it (the Base UI name).
readOnlybooleanfalseThe address shows and can be copied, but not changed (the Base UI name).
valuestring—The shown address (controlled).
defaultValuestring""The first shown address (uncontrolled).
onValueChange—Runs on every change with the text and the checks (four parts, each 0–255).
...props<div> attributes—Every other attribute goes to the <div>, with a ref.

IpAddressInputIcon

<div>
PropTypeDefaultDescription
classNamestring—
...props<div> attributes—Every other attribute goes to the <div>, with a ref.

IpAddressInputControl

<div>
PropTypeDefaultDescription
classNamestring—
guideboolean—The ghost guide of the slots still to fill, while the input has focus. Default true.
rawNamestring—Also submit the raw value under this name (a hidden input), next to the shown one.
rejectFeedbackboolean—Nudge the field 2px when the mask rejects a key. Default true.
onReject—Runs when the mask rejects a key (a letter in a number, a 13th month).
refRef<HTMLInputElement>—
rounded"default""full"—
size"default""lg""sm""xs"—
...props<div> attributes—Every other attribute goes to the <div>.
  • Use it for one IPv4 address, such as a server, a router, or a subnet mask.
  • Check it in a Field with ipv4().valid from lib/masks.
  • For an IPv6 address or a range with a slash, use a Input.
  • For another fixed format, use a Masked Input.

It is a native input with a decimal keypad, in a Field for the label and the error.

The network icon is decorative.

Rejected key
indicator · the frame moves 2px to each side and back when the mask rejects a key

Built with

Installs with IP Address Input

  1. AddedIP Address Input, with Input Group, Masked Input.
Open the release