|
@@ -1,9 +1,10 @@
|
|
|
-"""A heading component."""
|
|
|
+"""A highlight component."""
|
|
|
|
|
|
from typing import List
|
|
|
|
|
|
from pynecone.components.libs.chakra import ChakraComponent
|
|
|
-from pynecone.vars import Var
|
|
|
+from pynecone.components.tags import Tag
|
|
|
+from pynecone.vars import Dict, Var
|
|
|
|
|
|
|
|
|
class Highlight(ChakraComponent):
|
|
@@ -13,3 +14,10 @@ class Highlight(ChakraComponent):
|
|
|
|
|
|
# A query for the text to highlight. Can be a string or a list of strings.
|
|
|
query: Var[List[str]]
|
|
|
+
|
|
|
+ # The style of the content.
|
|
|
+ # Note: styles and style are different prop.
|
|
|
+ styles: Var[Dict] = {"px": "2", "py": "1", "rounded": "full", "bg": "teal.100"} # type: ignore
|
|
|
+
|
|
|
+ def _render(self) -> Tag:
|
|
|
+ return super()._render().add_props(styles=self.style)
|