I want to be able to use file-backed html, js, or css while making my own component using the v2 methodology. In order to do this, the documentation states that:
When using paths or globs to define one or more component assets, the paths must be relative to the component’s asset_dir as declared in the component manifest. This is only possible for installed components. For security reasons, absolute paths and path traversals are rejected. Because of runtime constraints, paths and globs must be provided as strings and not Path objects.
I think I don’t really understand this I think, and that might be the reason that I get this when I try to test my component:
streamlit.errors.StreamlitAPIException: Component ‘clickable_svg’ must be declared in pyproject.toml with asset_dir to use file-backed css.
At the moment, I’m trying to get one of the examples to work, but then instead of having the html, js and css in a string inside the python file (like the example has), I want to use files instead.
How would I develop a more advanced custom component if I cannot check it? Would I need to always use the string based approach?
It seems like I should be able to add something to my pyproject.toml, but whatever I do, it does not work. Also, I can’t seem to find any example or documentation of such a pyproject.toml.
Any help here would be appreciated!
Cheers, Dirk