Color Field
Enter a six-digit hex value directly in a text field.
Use # followed by six hexadecimal digits.
HTML
<div class="rl-scope" data-rl-scope>
<div class="rl-field">
<label class="rl-label" for="demo-color-field">Hex color</label>
<input class="rl-input" id="demo-color-field" type="text" aria-describedby="demo-color-field-hint" name="color" pattern="#[0-9a-fA-F]{6}" maxlength="7" value="#b9a5ff">
<p class="rl-description" id="demo-color-field-hint">Use # followed by six hexadecimal digits.</p>
</div>
</div>Validate the format again when the form reaches the server.
Use in your app
Copy these tags into your page head once. Serve the files at the paths shown, then add the example’s template to your page.
Page assets
<link rel="stylesheet" href="/mero.css">
<script defer src="/mero.js"></script>