Skip to main content

The component command

Sets up one or multiple new React components within a corgi app. Includes a .scss module file and an index file for each. Must be executed from the root of the project directory.

Basic usage

npx @wethegit/corgi@latest component

Arguments

ArgumentsDescription
name(s)A space-separated list of page component names. If you do not pass any name arguments, you will be prompted to enter a page component name.

Examples

npx @wethegit/corgi@latest component ToggleButton
npx @wethegit/corgi@latest component ToggleButton Pagination TabbedList
Subdirectories

You can create nested components using the CLI as well. For example, this is a valid command:

npx @wethegit/corgi@latest component common/ToggleButton

Options

FlagShort flagDescription
--help-hDisplays a list of arguments and options.