> For the complete documentation index, see [llms.txt](https://beyondeye.gitbook.io/compose-bloc/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://beyondeye.gitbook.io/compose-bloc/bloc-documentation/blocs-and-compose-overview/blocconsumer.md).

# BlocConsumer

### BlocConsumer with automatically retrieved Bloc

```kotlin
@Composable
public inline fun <reified BlocA: BlocBase<BlocAState>,BlocAState:Any> 
BlocConsumer(
    blocTag:String?=null,
    noinline buildWhen:BlocBuilderCondition<BlocAState>?=null,
    noinline listenWhen: BlocListenerCondition<BlocAState>?=null,
    crossinline listener: @DisallowComposableCalls suspend (BlocAState) -> Unit,
    crossinline content:@Composable (BlocAState)->Unit)
```

`BlocConsumer` exposes a `content` and `listener` in order react to new `Bloc` states. `BlocConsumer` is equivalent to a combined [BlocBuilder ](/compose-bloc/bloc-documentation/blocs-and-compose-overview/blocbuilder.md)and [BlocListener](/compose-bloc/bloc-documentation/blocs-and-compose-overview/bloclistener.md)

### BlocConsumer for externally provided Bloc

```kotlin
@Composable
public inline fun <reified BlocA: BlocBase<BlocAState>,BlocAState:Any>
BlocConsumer(
    externallyProvidedBlock:BlocA,
    noinline buildWhen:BlocBuilderCondition<BlocAState>?=null,
    noinline listenWhen: BlocListenerCondition<BlocAState>?=null,
    crossinline listener: @DisallowComposableCalls suspend (BlocAState) -> Unit,
    crossinline content:@Composable (BlocAState)->Unit)
```

This is the same as the previous method but with an explicitly specified `Bloc` instance `externallyProvidedBlock` , not retrieved implicitly from current registered blocs in the current composable subtree.

&#x20;Use this method if for example you have retrieved the Bloc already with [`rememberProvidedBlocOf` ](/compose-bloc/bloc-documentation/blocs-and-compose-overview/blocprovider.md#rememberprovidedblocof)
