►
Description
This community call demo is taken from the SharePoint Development monthly community call recording on 16th of May 2019. In this video, Chris Kent (DMI) demonstrates how to use SVGs in your column or view formatting json definitions.
Presenter - Chris Kent (DMI) - @thechriskent
Full details on the community call from https://developer.microsoft.com/en-us/sharepoint/blogs/
More details on the column formatting - https://docs.microsoft.com/en-us/sharepoint/dev/declarative-customization/column-formatting
Open-source samples for column and view formatting - https://github.com/SharePoint/sp-dev-list-formatting
More details on the SharePoint dev community calls from http://aka.ms/sppnp.
A
B
So
once
again
got
your
classic
warrior
horde
as
the
site
right
and
the
warrior
horses
are
nothing
if
not
prepared
at
all
times
so
they've
been
working
on
a
new
disaster
plan,
so
they've
been
listing
out
their
disasters
and
seeing
what
they
can
do
about.
So
we've
got
a
new
disasters
list
here,
so
we
come
in
here,
let's
zoom
in
a
little
bit
all
right,
so
they've
got
their
their
disaster.
They
got
a
plan.
You
can
see.
We've
already
applied
some
formatting
here.
We've
got
a
nice
icon
using
the
or
fabric
icons.
B
It's
a
nice
text.
We've
got
this
going
here
and
that's
okay,
but
the
horses
are
a
little
upset
about
this
icon
here
right,
the
balloons
icon
I
mean
that's,
that's
alright,
but
maybe
they
could
do
a
little
better,
get
something
a
little
more
disaster.
That
word
sure.
So
if
we
take
a
look
at
the
the
format,
that's
currently
applied
right,
it's
pretty
straightforward.
B
So
if
you
were
looking
for
something
looking
for
balloons
right
there,
they
are
that's
awesome.
You
can
do
that.
But
what,
if
you
want
something?
A
little
bit
different
I
mean
there's
like
Geoffrey
gamma-d,
those
1500
icons,
something
like
that.
It's
insane
keeps
growing,
but
there
isn't
really
one
that
expresses
the
true
rage
and
and
angst
these
horses
feel
at
the
disasters
they've
listed
here.
So
what
if
we
want
to
use
something
else,
say
an
icon
from
material
design
here
or
want
to
use
something
like
font
awesome
right,
he's
one
of
their
free
icons
here.
B
Can
we
do
that?
Right?
Generally
can't
use
them
directly
or
unless
you're
deploying
some
actual
code.
How
do
we
use
these
inside
list
formatting?
Well,
the
good
news
is:
is
that
list
formatting
supports
SVG
format,
so
you
can
insert
SVG's
directly
inside
your
formats,
which
gives
you
a
lot
of
options.
Some
bad
news
is
that
we
don't
know
we
I,
don't
it
doesn't
support
the
abstract
view
box,
which
is
really
important
for
SVG's
and
we'll
talk
about
why?
But
first,
let's
find
one
that
really
expresses
our
rage
here.
B
So
if
we
type
in
'probably
was
puh
storm
perfect
right,
so
is
there
any
better
way
to
describe
a
disaster
than
approve
storm
right,
so
the
nice
thing
about
these
sites
is
it
provides
this
download
SVG
button
here
right.
So
we
grab
that
mine.
There
are
some
different
licenses
and
everything
else
here
got
it.
Okay,
so
hit
that
button.
I
already
got
our
Pooh
storm
down
here
now.
In
order
to
use
this
right,
we
actually
need
to
grab
out
the
SVG
path
outside
of
that.
B
But
first
because
we
can't
do
view
box,
we've
got
to
make
sure
we
scale
that
properly
so
I'm
gonna
use
a
free
tool
called
Inkscape.
It's
an
open
source
free
tool.
You
can
get
it
I,
think
scape
dot-com
or
some
of
that
alright.
So
let's
go
and
get
our
qu
storm.
Perhaps
all
windows
we're
gonna
open
this
up
in
Inkscape,
which
will
bring
it
back
down
here.
So
you
can
see
there
is
our
two
storm.
It's
beautiful
now.
If
we
go
into
our
document
properties,
all
right,
we're
just
gonna
scale,
this
thing
down.
B
B
Control
you'll
see
in
this
alright.
Well,
good
news
is
I.
Pre
did
this.
So
if
we
have
to
okay
well,
just
pretend
I
scaled.
That
correctly,
once
that
is
scaled
correctly,
I
was
going
to
do,
is
resize
it
to
this
box.
You
can
open
this
thing
up
and
an
editor
say
like
vs
code,
so
we'll
just
close
that
saving
on
that
one.
So
if
we
open
up
our
vs
code
and
I
happen
to
have
a
again
I
prep
this
to
storm
solid
here,
you.
B
The
important
thing
here
is
this
path
alone
will
come
back
to
this.
This
crazy
coordinates
and
all
this
other
stuff
Inkscape
has
made
that
so
that
all
works
within
twenty
six
by
twenty
six
pixels.
So
let's
take
a
look
here,
alright,
so
if
we
go
back
or
format
here,
we
want
to
change
out
a
couple
things
right,
so
we
don't
want
this
span
with
the
icon
anymore,
so
we'll
just
I
should
just
kill
some
of
this,
so
we'll
just
element
type
of
set
of
span.
B
Let's
make
that
an
SVG
all
right,
so
we're
gonna
come
up
here,
alright,
that
an
SVG
we're
gonna
get
rid
of
these
attributes
here.
So
we
don't
need
to
do
icons
anymore,
right,
we're
gonna,
say
our
style.
Let's
have
a
couple
of
styles
here,
we're
gonna,
add
width
and
height,
just
to
make
sure
that
we
got
that
exactly.
We
want,
let's
just
paste,
those
in
right
and
then
I'm
gonna
set
a
fill
color
directly
to
match
this
theme
color,
because
right
now
there
isn't
a
Microsoft
UI
fabric
theme.
B
B
B
Okay,
that's
creepy
can't
avoid
it.
Alright,
so
we're
gonna
add
that
and
what
we're
gonna
do
is
red
LM
type
of
path.
So
this
is
really
the
only
time
you
ever
use
path
again.
This
is
a
little
more
advanced.
You
don't
generally
do
this,
but
here
we
go
all
right,
hold
type
path,
and
the
key
thing
here
is:
we
want
to
add
an
attribute
into
our
attributes.
Object
here,
and
this
attribute
is
the
D
attribute,
so
only
put
that
in
there
and
what
what
goes
in
there
is
what
we
saw
an
envious
code
here
right.
B
B
Okay,
let
me
go
grab
that
copy
that
I'm
gonna
head
back
to
my
format
there.
It
is
I'm,
just
gonna
paste
that
in
there
boom
you
see
it's
beautiful,
but
these
are
the
coordinates
that
make
up
the
beautiful
to
storm.
So
when
preview,
that
oh
yeah
font,
awesome
icon
right
here
got
ourselves
a
nice
pooh
storm
going
on
the
horses
happened
because
again
you
know
this
expresses
their
general
sadness
better
than
almost
anything
else
could
so
save
that?
Okay.
B
B
Alright,
so
we've
got
a
couple
of
samples
for
you
here,
so
there's
long,
there's
the
generic
SVG
icon
format,
which
takes
you
through,
and
what
it's
going
to
do
it's
going
to
use
conditional
here
to
set
some
of
these
font
off
some
icons
to
specify
gender?
So
you
can
take
a
look
at
that.
So
if
you
take
a
look
at
the
actual
format,
you
see
we're
doing,
the
same
kind
of
thing
gets
a
little
crazy,
we're
just
using
expressions
inside
that
D
attribute
to
change
which
ones
we
do
right.
B
B
B
B
Awesome
stuff
in
here
you
can
do
with
SVG
is
again
advanced
topic,
but
if
you
want
to
just
start
by
grabbing
some
fun
awesome
icons
or
something
else
there,
you
can
do
that.
So,
let's
review
alright
scalable
vector
graphics,
that's
what
SVG
stands
for.
You
just
use
the
LM
type
SVG
with
a
child
of
Helen
type
path.
Let's
specify
that
D
attribute
remember.
B
B
Do
be
aware
that
if
you
start
to
do
these
in
lots
of
expressions,
you
remember
that
that
was
some
crazy
stuff
with
those
coordinates
it
can
get
a
little
crazy.
There
are
not
technically
any
way
to
do
comments
in
here,
but
you
can
create
your
own
attributes
called
comment.
If
you
want
again,
it
will
be
ignored
by
the
the
engine
that
might
help
you
keep
track
of
what
icons
these
are
and
then
again
cool.
B
So
if
you're
interested
in
some
more
of
this
stuff,
I'm
going
to
go
ahead
and
promote
myself
a
little
bit
so
next
Tuesday,
if
you're
at
SPC
come
by
I'm
going
to
talk
about
this
is
the
first
session
and
if
you
are
in
Germany
and
a
week
after
that,
that
Tuesday
come
join
my
session
for
that
I'd
love
to
meet
all
of
you,
but
again
we'll
cover
all
this
kind
of
all
up
from
the
start.
And
then
here
are
some
samples.
So
here's
the
same.
Let's
pay
attention
to
here
is
the
blog.