Dexterity fields and Volto widgets for data used in Brazilian projects.
| Field | Holds | Shown as |
|---|---|---|
CEP 🏠 |
A postal code | 01310-100 |
CNPJ 🏢 |
The registration number of a company | 11.222.333/0001-81 |
CPF 🆔 |
The registration number of a person | 377.313.354-53 |
Estados 📍 |
A state, or the Federal District | São Paulo |
Telefone 📞 |
A phone number, landline or mobile | (11)98765-4321 |
The backend fields validate every value stored in them. The Volto widgets format each value while the editor types it, and warn about a wrong value before the form is sent.
📖 Read the documentation at plonegovbr.github.io/brfieldsandwidgets, and browse the widgets in Storybook.
This monorepo hosts two packages, released together:
backend/: the Python packageplonegovbr.brfields, with the Dexterity fields.frontend/packages/volto-brwidgets/: the npm package@plonegovbr/volto-brwidgets, with the Volto widgets.
| Plone | 6.1 and 6.2 |
| Python | 3.11 to 3.14 |
| Volto | 19, developed against 19.5.1 |
from plone.supermodel import model
from plonegovbr.brfields.fields import CNPJ
from plonegovbr.brfields.fields import CPF
class IEmpresa(model.Schema):
cnpj = CNPJ(title="CNPJ")
responsavel = CPF(title="CPF do responsável", required=False)Then add @plonegovbr/volto-brwidgets to your Volto project's add-ons.
The installation guides have the details.
- uv 🐍 (Python dependency manager)
- Node.js 24 🟩
- pnpm 🧶 (JavaScript package manager)
- Docker 🐳 (optional, for the container stack)
git clone git@github.com:plonegovbr/brfieldsandwidgets.git
cd brfieldsandwidgets
make installThis also creates a site with a demo content type using every field.
Start the Backend (Plone) at http://localhost:8080/:
make backend-startIn a new terminal, start the Frontend (Volto) at http://localhost:3000/:
make frontend-startmake test
make format
make lintmake storybook-start
make docs-liveThe stack builds both images from this repository, and serves them behind Traefik at http://brfieldsandwidgets.localhost:
make stack-create-site
make stack-startContributions are welcome! Check out:
Every pull request requires a change log entry, in one of these folders:
- repository:
news - backend:
backend/news - frontend:
frontend/packages/volto-brwidgets/news
This package is developed and maintained by the PloneGov-BR community ❤️.