im3000
How to set Surface top-level container CSS class?
Hello! I am playing with Surface, but can’t find a way to add CSS classes to the top-level Surface container, the way you can do in LiveView in your myapp_web.ex.
def live_view do
quote do
use Phoenix.LiveView,
container: {:div, class: "flex flex-col flex-grow"},
layout: {Myapp.LayoutView, "live.html"}
import Myapp.Views.InputHelpers
unquote(view_helpers())
end
end
FYI I am using Surface in only one part of my LiveView app. Any pointers on how to solve this?
Marked As Solved
Malian
Hi @im3000 !
Thanks for using Surface !
You normally should be able to use Surface.LiveView the same way as you use Phoenix.LiveView. I usually have something like this in my my_app_web.ex file.
def surface_live_view do
quote do
use Surface.LiveView,
container: {:div, class: "flex flex-col flex-grow"},
layout: {Myapp.LayoutView, "live.html"}
end
end
In top of your live view you could now use, use MyAppWeb, :surface_live_view
You could add similar helpers for Surface.Component and Surface.LiveComponent.
Does it solve your issue?
Popular in Questions
As the title describes, I’m trying to run Enum.map() over a list of key/value pairs, where the value is a map. My data looks like this:
...
New
This should be a simple problem but I just can’t seem to figure it out. I have a standalone Elixir app that won’t find the database.
Dep...
New
Hi there, I'm working through my first release with elixir/phoenix. I've built a release with distillery and found that it crashes when I...
New
What is most correct way to open, read and parse JSON file with poison?
For example if we have example.json file in root of some projec...
New
Hi,
I'm quite new in Elixir and I'm trying to format a string to a PEM format. I have the certificate value like MIIDBTCCAe2...... and ...
New
Hello everybody,
usually, I use a 29" ultra-wide monitor for VSCode which can easily accomodate explorer (files panel) + file with code ...
New
Hi guys, nice to meet you to the whole forum, I’m new here, I’m trying to configure visual studio code for elixir, right now the intellis...
New
About me? ( if you have nothing better to do than reading about some random guy in the internet :stuck_out_tongue: )
Hello all, this is ...
New
Can someone explain the settings of pool_size of Ecto in config file? and what is the recommend size?
Thanks
New
Mix format works fine if run from the cmd. I’ve followed this to facilitate the implementation into VSC which involves downloading an ext...
New
Other popular topics
As the title describes, I’m trying to run Enum.map() over a list of key/value pairs, where the value is a map. My data looks like this:
...
New
I’m working on defining a simple Ecto schema for a table (in PostGres), but I don’t see where I can define a column as NOT NULL. Conside...
New
Hello, I have map which I want to convert it to string like this:
the map:
%{last_name: "tavakkoli", name: "shahryar"}
the string I ne...
New
Hi guys, i’m new in the Elixir world, and i have to say, that i love it!
i’m having some problem to understand anonymous functions with ...
New
ExUnit now has describe blocks which is a welcome addition coming from RSpec. In the docs, it states that nested hierarchies of describe ...
New
Hi everyone,
One of the features added to Elixir early on to help integration with Erlang code was the idea of overridable function defi...
New
This post is an instruction guide to help you setup your Neovim for Elixir development from scratch. It includes general information on h...
New
by Lance Halvorsen
Elixir and Phoenix are generating tremendous excitement as an unbeatable platform for building modern web application...
New
Hi,
I have to write a raw query for one of my project. But till now I have used ecto queries and don’t have much experience writing raw ...
New
Hey :wave:t3: Elixir community,
I’ve been learning Elixir, and working on some side projects. My editor of choice is VSCode, and althoug...
New







