+
+ Card Title
+
+
+ This is the content of the card
+
+
+
+
+
+The ``render`` method can pretty-print the HTML by setting the ``pretty`` parameter to ``True``.
+
+JSON Rendering
+##############
+
+To convert components to the JSON representation, use the ``to_dict`` method from ``pydom.renderer``.
+This method returns a dict containing the JSON representation of the component.
+
+.. code-block:: python
+ :caption: Rendering the page as JSON
+
+ from json import dumps
+ from pydom.renderer import to_dict
+ from card import Card
+
+ card = Card(title="Card Title")(
+ "This is the content of the card"
+ )
+
+ json = to_dict(card)
+
+ print(dumps(json))
+
+This will output the following JSON:
+
+.. code-block:: json
+ :caption: JSON representation of the page
+
+ {
+ "type": "div",
+ "children": [
+ {
+ "type": "div",
+ "children": [
+ "Card Title"
+ ],
+ "props": {
+ "class": "card-title"
+ }
+ },
+ {
+ "type": "div",
+ "children": [
+ "This is the content of the card"
+ ],
+ "props": {
+ "class": "card-content"
+ }
+ }
+ ],
+ "props": {
+ "class": "card"
+ }
+ }
+
+This dict can be used to render components on the client side after the initial server-side rendering.
+
+It also corresponds to React's virtual DOM representation of the component.
+
+.. _props-rendering:
+
+Props Rendering
+###############
+
+When rendering components, some props names are converted to another name in the HTML representation.
+For example, the ``classes`` prop is converted to the ``class`` attribute in the HTML representation.
+
+The full list of prop names and their corresponding HTML attributes is as follows:
+
+- ``classes`` -> ``class``
+- ``html_for`` -> ``for``
+- ``access_key`` -> ``accesskey``
+- ``content_editable`` -> ``contenteditable``
+- ``cross_origin`` -> ``crossorigin``
+- ``tab_index`` -> ``tabindex``
+- ``use_map`` -> ``usemap``
+- ``col_span`` -> ``colspan``
+- ``row_span`` -> ``rowspan``
+- ``char_set`` -> ``charset``
+
+By default, all props with underscore in their name and a value of :py:type:`~pydom.types.Primitive` type,
+are converted to HTML attributes with dash instead of underscore.
+
+To configure this behavior check out the :ref:`property-transformers` page.
diff --git a/docs/user-guide/basics/syntax.rst b/docs/user-guide/basics/syntax.rst
new file mode 100644
index 0000000..a952f98
--- /dev/null
+++ b/docs/user-guide/basics/syntax.rst
@@ -0,0 +1,120 @@
+.. _syntax:
+
+######
+Syntax
+######
+
+PyDOM provides multiple syntaxes for creating instances of components.
+
+It is recommended to pick one syntax and sticking to it, as mixing syntaxes on different components can lead to confusion.
+
+Using the card component as an example, we will show the different syntaxes.
+
+.. code-block:: python
+ :caption: Card component
+
+ # card.py
+
+ from pydom import Component, Div
+
+ class Card(Component):
+ def __init__(self, title=None):
+ self.title = title
+
+ def render(self):
+ return Div(classes="card")(
+ self.title and Div(classes="card-title")(
+ self.title
+ ),
+ Div(classes="card-content")(
+ *self.children
+ )
+ )
+
+Which will result in the following HTML when passing the title "Card Title" and the content "Hello, World!":
+
+.. code-block:: html
+
+