Brazilian Fields and Widgets for Plone

Brazilian Fields and Widgets for Plone#

plonegovbr.brfields and @plonegovbr/volto-brwidgets give Plone fields and widgets for data used in Brazilian projects: CEP, CNPJ, CPF, states, and phone numbers.

A content type declares a field such as CPF in its schema. Plone validates every value stored in it, and Volto edits it with a widget that formats the value as the editor types.

from plone.supermodel import model
from plonegovbr.brfields.fields import CNPJ


class IEmpresa(model.Schema):
    cnpj = CNPJ(title="CNPJ")

Status: beta, tested with Plone 6.1 and 6.2, and with Volto 19.5.1. Compatibility has the full matrix and links to the changelogs.

Warning

This documentation was written with Claude Opus 5, following the Plone documentation style skill, and reviewed by a human being.

Where to start#

The packages are two add-ons, installed together. Install the backend first, then the frontend.

🎓 Tutorials

Fill in every field on a development site, and watch it validate.

Tutorials
🛠️ How-to guides

Install the packages, apply the demo profile, and add the fields to a content type.

How-to guides
💡 Concepts

Why a value is validated twice, and why it's stored as digits.

Concepts
📖 Reference

The fields, the widgets, the REST API, the vocabulary, and the profiles.

Reference

What it gives you#

Fields that validate. CEP, CNPJ, CPF, and Telefone refuse a value that isn't valid, whatever client stores it: a Volto form, a REST API client, or a script.

A states vocabulary. Estados offers the 26 states and the Federal District, from the plonegovbr.vocabulary.estados vocabulary.

Widgets that format as you type. The Volto add-on shows punctuation while the editor types, and hands Volto the digits alone.

Validators in the browser. The editor learns about a wrong value on the field that holds it, before the form is sent.

A demo profile. A content type that uses every field, and an example item, to try the packages on a development site.

Stories for every widget. The Storybook renders each widget the Volto add-on ships, built from this repository and published beside these pages.

What you need#

Dependency

Version

Plone

6.1 or 6.2

Python

3.11 to 3.14

Volto

Developed against 19.5.1