# Built-in directives
Directives are classes that add additional behavior to elements
in your Angular applications.
With Angular's built-in directives, you can manage forms, lists, styles, and what users see.
Built-in directives use only public APIs.
They do not have special access to any private APIs that other directives can't access.
{@a ngClass}
## Adding and removing classes with `NgClass`
You can add or remove multiple CSS classes simultaneously with `ngClass`.
To add or remove a *single* class, use [class binding](guide/attribute-binding#class-binding) rather than `NgClass`.
### Using `NgClass` with an expression
On the element you'd like to style, add `[ngClass]` and set it equal to an expression.
In this case, `isSpecial` is a boolean set to `true` in `app.component.ts`.
Because `isSpecial` is true, `ngClass` applies the class of `special` to the ``.
### Using `NgClass` with a method
1. To use `NgClass` with a method, add the method to the component class.
In the following example, `setCurrentClasses()` sets the property `currentClasses` with an object that adds or removes three classes based on the `true` or `false` state of three other component properties.
Each key of the object is a CSS class name.
If a key is `true`, `ngClass` adds the class.
If a key is `false`, `ngClass` removes the class.
1. In the template, add the `ngClass` property binding to `currentClasses` to set the element's classes:
For this use case, Angular applies the classes on initialization and in case of changes.
The full example calls `setCurrentClasses()` initially with `ngOnInit()` and when the dependent properties change through a button click.
These steps are not necessary to implement `ngClass`.
For more information, see the
`app.component.ts` and `app.component.html`.
{@a ngstyle}
## Setting inline styles with `NgStyle`
You can use `NgStyle` to set multiple inline styles simultaneously, based on the state of the component.
1. To use `NgStyle`, add a method to the component class.
In the following example, `setCurrentStyles()` sets the property `currentStyles` with an object that defines three styles, based on the state of three other component properties.
1. To set the element's styles, add an `ngStyle` property binding to `currentStyles`.
For this use case, Angular applies the styles upon initialization and in case of changes.
To do this, the full example calls `setCurrentStyles()` initially with `ngOnInit()` and when the dependent properties change through a button click.
However, these steps are not necessary to implement `ngStyle` on its own.
See the
`app.component.ts` and `app.component.html` for this optional implementation.
{@a ngModel}
## Displaying and updating properties with `ngModel`
You can use the `NgModel` directive to display a data property and update that property when the user makes changes.
1. Import `FormsModule` and add it to the NgModule's `imports` list.
1. Add an `[(ngModel)]` binding on an HTML `