Skip to main content

6cons

Lucide icons as native PyReact SVG components.

PyPI Python PyReact Lucide License: ISC

6cons adapts the complete Lucide icon catalog to PyReact. Every icon is a Python function that returns an SVG VNode, so it works with composition, events, SSR, accessibility attributes, and UIKitPR utility classes without a JavaScript runtime.

This project is an independent community port. It is not affiliated with or endorsed by the Lucide maintainers.

Installation with PRPM

prpm add 6cons

Installation with pip is also supported:

python -m pip install 6cons

The distribution is named 6cons; the Python import package is sixcons because Python identifiers cannot start with a digit.

Quick start

from sixcons.icons import CircleCheck, Search


def Toolbar(props):
    return Search(
        size=20,
        color="currentColor",
        stroke_width=1.75,
        class_name="text-primary",
        label="Search",
    )


status = CircleCheck(size=24, color="#16a34a")

Use any icon by its Lucide name when a dynamic lookup is more convenient:

from sixcons import icon

settings_icon = icon("settings", size=18)

Named components also work through PyReact's h():

from pyreact import h
from sixcons.icons import Bell

node = h(Bell, {"size": 20, "label": "Notifications"})

API

icon(name, props=None, **attributes)

Creates an SVG VNode for a kebab-case Lucide icon name.

Common options:

Option Default Description
size 24 SVG width and height
color "currentColor" Stroke color
stroke_width 2 Stroke width
absolute_stroke_width False Keep the visual stroke constant when resizing
class_name / className — Additional CSS classes
label — Accessible label; otherwise the icon is decorative

All other attributes, including events, data-*, aria-*, and style, are forwarded to the root SVG VNode.

Catalog helpers

from sixcons import get_icon_data, icon_names, search_icons

all_names = icon_names()
matches = search_icons("arrow")
nodes = get_icon_data("search")

Server-side rendering

from pyreact import render_to_static_markup
from sixcons.icons import Heart

html = render_to_static_markup(Heart(size=32, color="red", label="Favorite"))

Updating from Lucide

The generated catalog is pinned to Lucide 1.27.0 at commit 4aec3f892fd6c23063bc2fead83c899b5d412b1c.

To regenerate from a local Lucide checkout:

python scripts/sync_lucide.py \
  --source ../lucide/icons \
  --version 1.27.0 \
  --commit 4aec3f892fd6c23063bc2fead83c899b5d412b1c

The generator validates every SVG and produces deterministic catalog and component modules.

Development

python -m pip install -e ".[dev]"
python -m pytest
python -m build
python -m twine check dist/*

License and attribution

The icon data is derived from Lucide, released under the ISC License. Icons inherited from Feather are covered by the MIT License. The complete upstream notices are preserved in LICENSE.

Metadata

Release files for 6cons 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for 6cons 0.1.0
File Size Uploaded
6cons-0.1.0.tar.gz 119.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for 6cons 0.1.0
File Interpreter ABI Platform
6cons-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 239.5 kB

Release files / 6cons-0.1.0.tar.gz

Download URL 6cons-0.1.0.tar.gz
Size 119.9 kB
Tags Source
SHA-256 checksum
How to use checksums
2f59c8863182df45386aee1ecb01c920048b9bce12343e55d893781c45b53085
BLAKE2b-256 checksum
How to use checksums
1b10cabbbb509eaf01fd281b38c1bf1679c578a7ae3956aa2d037349016fd819
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.5

Release files / 6cons-0.1.0-py3-none-any.whl

Download URL 6cons-0.1.0-py3-none-any.whl
Size 119.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4986d6c0047b1d33b6df2dbf02a99ef29c3d5d85d072e3152b56aac2851c2d48
BLAKE2b-256 checksum
How to use checksums
bc919ee37eaa0267583c5571dac17e8acc8ba4885cccd49a165aabf7e03f1dc5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.5

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page