Components / Modals and sheets
Form in a modal
A short form in a dialog: two fields, help text, and the submit button that names the result.
The code
Plain HTML and CSS on your kit's variables. Put it next to tokens/variables.css from your kit's files and it draws in your look.
<div class="ukc-modal-form-modal">
<div class="bd"><form class="dlg" role="dialog" aria-modal="true" aria-labelledby="ukc-fm" action="#">
<h3 id="ukc-fm">Add a client</h3>
<label>Name<input type="text" value="Bay Cabinets"></label>
<label>Billing email<input type="email" placeholder="accounts@client.com"></label>
<p class="help">Invoices for this client go to the billing email.</p>
<div class="row"><button class="btn" type="button">Cancel</button><button class="btn pri" type="button">Add client</button></div>
</form></div>
</div>
.ukc-modal-form-modal { position: relative; font-family: var(--uk-font-body, system-ui, sans-serif); color: var(--uk-ink); font-size: 15px; line-height: 1.5;
--tint: color-mix(in srgb, var(--uk-accent) 12%, var(--uk-paper));
--tint-strong: color-mix(in srgb, var(--uk-accent) 22%, var(--uk-paper));
--accent-deep: color-mix(in srgb, var(--uk-accent) 72%, black);
--ink-soft: color-mix(in srgb, var(--uk-ink) 8%, var(--uk-paper));
--line-strong: color-mix(in srgb, var(--uk-ink) 32%, var(--uk-paper));
--danger-tint: color-mix(in srgb, var(--uk-danger) 12%, var(--uk-paper));
--high-tint: color-mix(in srgb, var(--uk-highlight) 28%, var(--uk-paper)); }
.ukc-modal-form-modal *, .ukc-modal-form-modal *::before, .ukc-modal-form-modal *::after { box-sizing: border-box; }
.ukc-modal-form-modal :where(h1, h2, h3, h4, p, ul, ol, dl, dd, figure, blockquote) { margin: 0; }
.ukc-modal-form-modal :where(ul, ol) { padding: 0; list-style: none; }
.ukc-modal-form-modal :where(button, input, select, textarea) { font: inherit; color: inherit; }
.ukc-modal-form-modal :where(a) { color: inherit; }
.ukc-modal-form-modal svg { flex: none; }
.ukc-modal-form-modal .bd { display: grid; place-items: center; padding: 28px 16px; border-radius: var(--uk-radius-lg); background: color-mix(in srgb, color-mix(in srgb, var(--uk-ink) 20%, black) 50%, transparent); }
.ukc-modal-form-modal .dlg { width: 100%; max-width: 440px; background: var(--uk-paper); border-radius: var(--uk-radius-lg); box-shadow: 0 20px 50px color-mix(in srgb, color-mix(in srgb, var(--uk-ink) 20%, black) 35%, transparent); }
.ukc-modal-form-modal .btn { padding: 9px 16px; border: 1px solid var(--uk-line); border-radius: var(--uk-radius-md); background: var(--uk-paper); font-weight: 600; cursor: pointer; }
.ukc-modal-form-modal .btn.pri { background: var(--uk-accent); border-color: transparent; color: var(--uk-accent-ink); }
.ukc-modal-form-modal .btn.danger { background: var(--uk-danger); border-color: transparent; color: var(--uk-paper); }
.ukc-modal-form-modal .dlg { padding: 24px; display: grid; gap: 12px; }
.ukc-modal-form-modal h3 { font-size: 20px; font-family: var(--uk-font-display, inherit); }
.ukc-modal-form-modal label { display: grid; gap: 6px; font-weight: 600; font-size: 14px; }
.ukc-modal-form-modal input { height: 40px; padding: 0 12px; border: 1px solid var(--uk-line); border-radius: var(--uk-radius-md); background: var(--uk-paper); font-weight: 400; }
.ukc-modal-form-modal .help { font-size: 13px; color: var(--uk-muted); }
.ukc-modal-form-modal .row { display: flex; justify-content: flex-end; gap: 8px; margin-top: 4px; }
More modals and sheets
All 25Share "Kitchen reframe"
- MRMara ReyesOwner
- DWDana WhitfieldCan edit
Step 2 of 3
How do clients pay you?
North wall, before drywall3 / 48 Choose your location