# Features

> Features are the heart of Flipper. They allow you to control code execution by enabling features in certain conditions.

###### Checking if a feature is enabled {#enabled}

```ruby
if Flipper.enabled?(:my_feature)
  # do the thing
else
  # do the other thing
end
```

## Managing features {#managing}

Features can be added, removed, and listed using the Flipper DSL. Adding a feature registers it with the adapter without enabling it, which is useful for tracking known features in the UI or API.

###### `Flipper.add` {#add}

```ruby
# Add a feature without enabling it
Flipper.add(:search)
```

Adding a feature makes it visible in the UI, API, and `Flipper.features` without changing its state. Features are also implicitly added when you enable them.

###### `Flipper.remove` {#remove}

```ruby
# Remove a feature and all its gate data
Flipper.remove(:search)
```

Removing a feature deletes it and **all of its gate data** (actors, groups, percentages, etc.) from the adapter. This is a destructive action—use `Flipper.disable` if you just want to turn a feature off.

###### `Flipper.exist?` {#exist}

```ruby
Flipper.exist?(:search) # false

Flipper.add(:search)
Flipper.exist?(:search) # true
```

###### `Flipper.features` {#features-list}

```ruby
Flipper.add(:search)
Flipper.add(:stats)

Flipper.features.each do |feature|
  puts feature.name
end
# => search
# => stats
```

## Enabling and disabling features {#enable}

Flipper allows you to enable and disable feature flags for different users at runtime. You have control over the scenarios and conditions that enable a feature for a given actor, group, percentage of actors, percentage of time, or even custom expressions that you define. This means you can turn features on and off for certain users—but not others—without deploying new code.

There are 6 different ways to enable a feature:

1. [Boolean](/docs/features/boolean)
1. [Actors](/docs/features/actors)
1. [Percentage of Actors](/docs/features/percentage-of-actors)
1. [Percentage of Time](/docs/features/percentage-of-time)
1. [Groups](/docs/features/groups)
1. [Expressions](/docs/features/expressions)
