---
title: "Required field animated icon"
description: "Required field animated icon (Forms & input). A form field is flagged as required. Light: the asterisk beside the field's label pops up to a larger size with a quick twist and snaps back, and a beat later the empty field below dips under the flag and springs back. Strong: the asterisk crouches, pops bigger with a wider twist, snaps back and pops once more, smaller; the field dips with each pop. The label and asterisk keep their places."
canonical: https://generativeicons.com/icons/required-field/
---

# Required field animated icon

A form field is flagged as required. Light: the asterisk beside the field's label pops up to a larger size with a quick twist and snaps back, and a beat later the empty field below dips under the flag and springs back. Strong: the asterisk crouches, pops bigger with a wider twist, snaps back and pops once more, smaller; the field dips with each pop. The label and asterisk keep their places.

- Id: `required-field`
- Category: Forms & input
- Search terms: mandatory, mandatory field, asterisk, compulsory, obligatory, must fill, must complete, not optional
- One action, back to rest
- Styles: outline, solid, duotone; outline weights 1.5, 2, 2.5 (any from 1 to 3); motion light or strong
- File: https://generativeicons.com/assets/required-field.lottie (dotLottie, 3769 bytes, sha256 8c108b0fa1863cd56d414020163d871232c90c316603653ed17789943d9c7743)
- License: MIT

## Install

```sh
npm install @lottiefiles/generative-icons-runtime
npx generative-icons init
npx generative-icons add required-field
```

## React

```tsx
// npm install @lottiefiles/generative-icons-react
'use client';
import { AnimatedIcon } from '@lottiefiles/generative-icons-react';
import icon, { src } from './generative-icons/required-field.mjs';

export function RequiredFieldIcon() {
  return <AnimatedIcon icon={icon} src={src} size={32}
    color="#ffffff" variant="outline" weight={2}
    motion="light" theme="dark" />;
}
```

## JavaScript

```js
import { createIcon } from '@lottiefiles/generative-icons-runtime';
import icon, { src } from './generative-icons/required-field.mjs';

const handle = await createIcon(canvas, {
  icon, src,
  color: '#ffffff', style: 'outline', weight: 2,
  motion: 'light', theme: 'dark'
});
button.addEventListener('click', () => handle.play());
// On removal: handle.destroy();
```

More: https://generativeicons.com/icons/required-field/ · https://generativeicons.com/api/icons/required-field
