# `mix elementorex.gen.block`
[🔗](https://github.com/rocket4ce/elementorex_cms/blob/v0.1.0/lib/mix/tasks/elementorex.gen.block.ex#L1)

Generates a block for the visual editor, with props for the inspector, its
render function and a test.

    $ mix elementorex.gen.block Pricing
    $ mix elementorex.gen.block Marketing.HeroBanner --category layout --container --icon sparkles

Creates `lib/my_app_web/blocks/pricing.ex` (module `MyAppWeb.Blocks.Pricing`)
and `test/my_app_web/blocks/pricing_test.exs`. Register it afterwards:

    config :elementorex_cms, blocks: [MyAppWeb.Blocks.Pricing]

## Options

  * `--type` - type stored in documents (default: the snake_case name)
  * `--label` - name in the palette (default: from the module name)
  * `--icon` - Heroicons name for the palette (default `square-3-stack-3d`)
  * `--category` - `layout`, `basic`, `components`, `media`, `advanced` or
    your own (default `components`)
  * `--container` - the block holds child blocks
  * `--namespace` - module namespace (default `MyAppWeb.Blocks`)
  * `--no-test` - skip the test
  * `--force` - overwrite existing files

---

*Consult [api-reference.md](api-reference.md) for complete listing*
